3 c# c++ enums namespaces public
如何将命名空间中的枚举设置为public,以便可以在代码中的任何位置访问它?我正在尝试将C#程序转换为c ++
我放
namespace foo {
public: enum foo{}
}
Run Code Online (Sandbox Code Playgroud)
但这显然不起作用.有什么建议?
在C++中,名称空间中的任何内容都是公共的.只需使用:
namespace foo {
enum foo {
bar,
baz
};
}
Run Code Online (Sandbox Code Playgroud)