using namespace xxx;
を書かずにユーザー定義のリテラルを書くことは可能ですか?例えば<literal value><namespace>::<UDL>;
ような何か式の中でnamespace :: user-defined-literalsを直接使用することはできますか
namespace tostr
{
std::string operator "" _UP(const char *str, unsigned long long int)
{ //transformation goes here
}
}
int main(int argc, char** argv)
{
//using namespace tostr;
//std::string upperCase = "hello world.\n"_UP; //OK : Works perfectly.
//Something like this
std::string upperCase = "hello world.\n"tostr::_UP; //????
}
試しましたか? – DeiDei