Overcoming the “Most Vexing Parse” Problem
he C++ literature uses the phrase “most vexing parse” to denote one of the dark syntactic alleys of C++. It’s vexing because programmers usually don’t even know it exists; they
he C++ literature uses the phrase “most vexing parse” to denote one of the dark syntactic alleys of C++. It’s vexing because programmers usually don’t even know it exists; they
ere’s a common scenario: a base class has multiple constructors, each of which takes a different number of parameters of various types. A derived class has to declare “mirror constructors”
ormally, you initialize data members in a constructor’s member initialization list. When a class has multiple constructors, each constructor initializes the object’s members individually, which often leads to repeating the
ood old object-oriented programming is still alive and kicking. In many C++ frameworks and applications where inheritance and virtual functions thrive you often need to create a derived object whose
our years ago, I presented a pioneer proposal for adding lambda expressions to standards C++. The lambda proposal has since undergone significant revisions and enhancements. In their new form, C++0x
ntil not long ago, a standardized multithreading API for C++ was a pipe dream. Almost every operating system, compiler, and framework rolled their own threading libraries. These proprietary libraries were
lass objects use a constructor argument list as their initializer, aggregates use braces, strings use literal text with double quotes, and containers use yet another form of initialization. These diverse
he compiler invokes user-defined conversion functions (which are also called conversion operators) implicitly. In most cases, this process is well-behaved and intended. However, there are cases when you certainly don’t
td::auto_ptr was a move semantics pioneer. However, at that time, C++ didn’t have the facilities for supporting move operations that were both safe and efficient. After years of distilling, C++0x