我在一个名为的文件中有以下代码Console.hpp
:
inline std::wstring operator "" _t(const char* s)
{
std::wstring_convert<codecvt_utf8_utf16<wchar_t>> converter;
std::wstring wide = converter.from_bytes(s);
return console::typografix(wide);
}
inline std::wstring operator "" _t(const wchar_t* w, size_t _)
{
return console::typografix(w);
}
现在,在里面Main.cpp
,我有一个#include "Console.hpp"
并且正在尝试使用后缀
"Like this"_t
不幸的是,我收到以下错误:
错误 C3688 无效文字后缀 '_t'; 未找到文字运算符或文字运算符模板'operator ""_t'
有人可以帮我弄清楚发生了什么吗?