If the nested struct will contain only static constant members, will it affect performance anyhow? I want to use it to scope these constants.
class File {
public:
struct Mode {
static const int Read = 0x01, Write = 0x02, Append = 0x04;
};
};
Is this a good practice?
完全不是,变量是在编译时而不是运行时解析的。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.