Invictus
Invictus

Reputation: 4338

What is a non-delegating constructor in c++

can someone let me know What is a non-delegating constructor ?

I tried to google it but could not find anything useful

Upvotes: 2

Views: 592

Answers (1)

Benjamin Gruenbaum
Benjamin Gruenbaum

Reputation: 276306

All it means is that the constructor does not delegate. (Which is the case unless you've made some calls between your constructors).

Constructor delegation is quite common in other and newer languages today, all it means is that the constructor is calling another constructor to prevent code duplication and maintain clean code.

Here is a simple tutorial on constructor delegating:

http://www.learncpp.com/cpp-tutorial/b-5-delegating-constructors/

Upvotes: 4

Related Questions