Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class C {
- enum { X = 42; }
- };
- class C {
- static const auto X = 42;
- };
- static const auto X = 1ul;
- enum { X = 1 };
- enum : unsigned long { Y = 1 };
- struct C {
- static const auto X = 1;
- };
- int f(const int& arg) {
- return arg;
- }
- int main() {
- return f(C::X);
- }
- main.cpp:(.text+0x15): undefined reference to `C::X'
- struct C {
- static const int X;
- };
- const int C::X = 1;
- f(static_cast<int>(C::X)); // явный каст
- f(+C::X); // унарный плюс
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement