Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨,在 boost mpl 文档中,我发现了 mpl::string 和以下示例:
typedef mpl::string<'hell','o wo','rld'> hello;
我有点惊讶,因为我认为在 C 或 C++ 中,字符'之间不能有多个字符?
正常有效吗?
是的,它是有效的 C++。从任何现有的 C++ 标准,[lex.conn] 部分:
包含多个c-char的普通字符文字是多字符文字。多字符文字具有类型int和实现定义的值。
int