Questions tagged «alias»

别名是替代名称。在计算机科学中,最常见的上下文是Shell中的命令别名,数据库中的列别名或C ++等语言中的变量引用。

1
非公共类型的公共别名
我想知道它是否有效的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, …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.