I am seeing some behavior I can't quite explain. Consider test.cpp
:
#include <iostream>
long double operator"" _N(long double a) { return a; }
int main(int argc, char** argv) {
long double t = 4.0_N;
}
Issuing
g++ -std=c++11 test.cpp
gives me
test.cpp:2:22: error: expected suffix identifier
long double operator"" _N(long double V) { return V; }
^
Making any of the the following changes will NOT give the error:
// #include <iostream> // Is there some conflict with something in iostream then?
long double operator"" _N(long double a) { return a; }
...
#include <iostream>
long double operator"" _P(long double a) { return a; }
// (or most other letters and/or words)
...
however, the problem persists for at least _B
and _C
(I didn't test the entire alphabet)...
What am I missing here?
More info:
$ g++ --version
g++ (GCC) 4.8.2
Running in CygWin on 64-bit Windows 7 SP1.