Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between =default and empty constructor with no arguments? [duplicate]

Tags:

c++

c++11

Difference between =default and empty constructor with no arguments?

Is there difference between:

MyClass() {}
MyClass() = default;
like image 711
user3111311 Avatar asked Jan 16 '14 14:01

user3111311


1 Answers

Overall No there is not. ;)

It will do overall the same, but not exactly (like sftrabbit, Nawaz, and 0x499602D2 suggest it, thanks by the way).

You will find an answer to your question here ;)

like image 105
Axel Borja Avatar answered Oct 07 '22 18:10

Axel Borja