그것이 유효한 C ++인지 궁금합니다.
class Test {
struct PrivateInner {
PrivateInner(std::string const &str) {
std::cout << str << "\n";
}
};
public:
using PublicInner = PrivateInner;
};
//Test::PrivateInner priv("Hello world"); // Ok, private so we can't use that
Test::PublicInner publ("Hello World"); // ?, by using public alias we can access private type, is it ok ?
1
왜 코드가 유효하지 않습니까?
—
NathanOliver