Consider:
struct str {};
str operator"" _X(long double d) {
return str();
}
This compiles fine with g++ 4.7.2 Wall std=c++11
but now if I give a double :
str operator"" _X(double d) {
return str();
}
I get the following error message:
main.cpp|3|error: 'str operator"" _X(double)' has invalid argument list
What is the problem ? Has this something to do with "It is not possible to redefine the meaning of a built-in literal suffix" (Stroustrup FAQ) ?
Can you think of a workaround ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…