c++ - What's the point in defaulting functions in C++11? -
C ++ 11 adds the ability to say any compiler. Where can I see the value of deleting a function, where is a function explicitly given default values? Leave it blank now and the compiler will do it anyway.
Only one point I can see is that a default constructor is created when there is no other constructor present:
class like {public: eg (int i) ; Like () = default; }; But is it really better how do you do it?
class examples {public: eg (int i); like () {}}; Or am I missing a use-case?
A default constructor will have an announcement, and this announcement will be subject to general access rules. Just like you can make the default copy creator protected, without these new announcements, the default generated members are public.
Comments
Post a Comment