I've stumbled across a statement on cppreference that says:
Constructors have no names and cannot be called directly.
Is that true? Up until now, I've thought that the NAME of a constructor is always the respective class name. However, now it makes me wonder if this is actually the RETURN TYPE as constructors do kind of return (initialized) instances of a class, don't they?
Furthermore, what is it about "cannot be called directly"?
Suppose I have the following code snippet:
class A
{
// some members
};
A x = A();
A()
is a direct call to the default constructor here, isn't it? Or am I having a big misconception about both these things?
I'd appreciate any help a lot!
Best regards, Ruperrrt