I noticed that declaring an instance of a class with an explicit ()
does not throw an error despite having deleted the default constructor, why is this?
class Foo {
public:
Foo() = delete;
};
int main() {
//Foo foo; // Throws an error as expected
Foo bar(); // Does not throw an error
return 0;
}
Compilation invocation: g++ -std=c++14 foo.cpp