I have the following C++ declaration:
struct S {
private:
S();
};
struct T {
S s;
};
Why isnt it illegal C++?
It gives the false impression that a member function of S can
instantiate
an object of the type T.
If an object of type T cannot be constructed under any
circumstance, then
why allow the type declaration to pass in the first place?
struct S {
private:
S();
};
struct T {
S s;
};
Why isnt it illegal C++?
It gives the false impression that a member function of S can
instantiate
an object of the type T.
If an object of type T cannot be constructed under any
circumstance, then
why allow the type declaration to pass in the first place?
Comment