This works in xcode, but not visual studio. The error is
error C2236: unexpected ‘enum’ ‘abc::def::`anonymous-namespace’::’. Did you forget a ‘;’?
I can’t figure out what is wrong.
namespace abc {
namespace def {
namespace {
long long enum {
aaa = 1L,
bbb = 2L,
};
}
}
}
That syntax is bizarre, I don’t see how it would work anywhere (EDIT: apparently it’s a GCC extension — thanks @PlasmaHH). This is the portable C++11 syntax you want: