I have already seen the following exmaple on it's usage:
#include <iostream>
using namespace std;
class A {
public:
// A user-defined
// parameterized constructor
A(int x)
{
cout << "This is a parameterized constructor";
}
// Using the default specifier to instruct
// the compiler to create the default
// implementation of the constructor.
A() = default;
};
But to me A() = default;
can simply be replaced with A() {}
, an empty default constructor. I don't get the point of the default
keyword here. Am I missing something?