What's the point in defaulting functions in C++11?

后端 未结 8 1446
失恋的感觉
失恋的感觉 2020-12-03 03:41

C++11 adds the ability for telling the compiler to create a default implementation of any of the special member functions. While I can see the value of deleting a function,

8条回答
  •  情深已故
    2020-12-03 03:45

    I suspect that being able to default generate the copy constructor will be actually useful. I can't see a use for default generating the default constructor since as you say the implementation you type in would be shorter.

提交回复
热议问题