Are you required to have have copy constructors and assignment operators defined as well to make use of this new feature of c++11?
2 replies to this topic
#1
Posted 01 May 2013 - 11:50 AM
#2
Posted 02 May 2013 - 12:59 AM
I have found that if your class needs a non-default assignment, copy constructor, or destructor, then you probably need all three or else you're likely going to shoot yourself in the foot (un)expectedly.
Likewise, if you don't need any of these, then you should let the compiler generate the optimized defaults for them, since it will treat it POD.
Likewise, if you don't need any of these, then you should let the compiler generate the optimized defaults for them, since it will treat it POD.
#3
Posted 04 May 2013 - 10:23 AM
The Rule of the Big 3 in my programming class. If you ever need to define either, a Copy Constructor, Destructor, or Assignment, then you better define all three. What's this new C++11? *googles*I have found that if your class needs a non-default assignment, copy constructor, or destructor, then you probably need all three or else you're likely going to shoot yourself in the foot (un)expectedly.
Likewise, if you don't need any of these, then you should let the compiler generate the optimized defaults for them, since it will treat it POD.
Also tagged with one or more of these keywords: c++11
→
Computers and Technology →
Need some OOP excercisesStarted by Mero , 29 Apr 2013 |
|
|
||
→
Computers and Technology →
Operator Overloading and CastingStarted by Mero , 22 Apr 2013 |
|
|
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users

