<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>c++ on Home Page</title><link>https://ehsanakhgari.org/tags/c++/</link><description>Recent content in c++ on Home Page</description><generator>Hugo -- gohugo.io</generator><language>en-ca</language><copyright>To the extent possible under law, Ehsan Akhgari has waived all copyright and related or neighboring rights to this website. This work is published from: Canada.</copyright><lastBuildDate>Mon, 07 Dec 2015 19:39:43 +0000</lastBuildDate><atom:link href="https://ehsanakhgari.org/tags/c++/index.xml" rel="self" type="application/rss+xml"/><item><title>C++ Static Analysis using Clang</title><link>https://ehsanakhgari.org/blog/2015-12-07/c-static-analysis-using-clang/</link><pubDate>Mon, 07 Dec 2015 19:39:43 +0000</pubDate><guid>https://ehsanakhgari.org/blog/2015-12-07/c-static-analysis-using-clang/</guid><description>Introduction Large code bases typically develop rules around how various code constructs should be used. These rules help eliminate bugs resulting from common mistakes. C++ gives programmers a good amount of power over enforcing such rules using the facilities that the language provides. As a simple example, if you have a class that should not be inherited from, you can mark the class as final. Typically one finds themselves in a situation where the language doesn't provide an easy way to enforce something.</description></item><item><title>C++ deleting destructors</title><link>https://ehsanakhgari.org/blog/2012-12-11/c-deleting-destructors/</link><pubDate>Tue, 11 Dec 2012 07:14:19 +0000</pubDate><guid>https://ehsanakhgari.org/blog/2012-12-11/c-deleting-destructors/</guid><description>Recently during a code review, Benoit pointed out a strange linker error, that neither of us expected. Here's what the situation roughly looked like:
$ cat test.cpp #include &amp;lt;new&amp;gt; class Base { public: virtual ~Base() {} }; class Derived : public Base { public: ~Derived() {} private: void* operator new(size_t); void* operator new[](size_t); void operator delete(void*); void operator delete[](void*); }; int main() { Derived d; return 0; } $ clang++ test.</description></item></channel></rss>