Skip to content

Instantly share code, notes, and snippets.

@endJunction
Last active December 21, 2015 23:28
Show Gist options
  • Save endJunction/6382165 to your computer and use it in GitHub Desktop.
Save endJunction/6382165 to your computer and use it in GitHub Desktop.
static const integral class member definition in c++ compile with $(CXX) -std=c++11 main.cpp
namespace b_space {
struct B
{
static const int j = 42;
};
}
#include <iostream>
#include "b.h"
namespace a_space {
struct A
{
static const int i = 23;
};
} // a_space
int main(void)
{
std::cout << a_space::A::i << "\n";
std::cout << b_space::B::j << "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment