M
Matthias Kaeppler
Hi,
say I have an arbitrary class Bar:
1 Bar a;
2 Bar b(a);
3 Bar c = a;
In line 3, is the default ctor called for c _first_ and _then_ the
assignment operator, or is c never default constructed and immediately
initialized with a?
My point is, for complex objects, is it likely that initialization via
assignment is less efficient than via constructor calls? What is the
recommended approach?
say I have an arbitrary class Bar:
1 Bar a;
2 Bar b(a);
3 Bar c = a;
In line 3, is the default ctor called for c _first_ and _then_ the
assignment operator, or is c never default constructed and immediately
initialized with a?
My point is, for complex objects, is it likely that initialization via
assignment is less efficient than via constructor calls? What is the
recommended approach?