Delegating Constructors in C++11 -- 741MHz

In case you missed it on 741MHz:

Delegating Constructors in C++11

by 741MHz

From the article:

C++ has caught up with other popular object-oriented languages such as Scala, Java, C# and others when it comes to constructor delegation, a feature that is now supported as per 2011 core language specification of ISO C++. This solves a common problem with repetitive coding, which is tedious and fragile, that C++ programmers had to do in order to provide multiple class constructors.

...

C++11 allows that a constructor of a class type “A” may have an initializer list that invokes another constructor of the same type. Therefore, programmers can get rid of undesirable common initialization function and duplicate all at once by writing the code like this: ...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.