title: C++ : Initializing base class constant static variable with different value in derived class?
body: <p>I have a base class A with a constant static variable a. I need that instances of class B have a different value for the static variable a. How could this be achieved, preferably with static initialization ? </p>
  
  <pre><code>class A {
  public:
      static const int a;
  };
  const int A::a = 1;
  
  class B : public A {
      // ???
      // How to set *a* to a value specific to instances of class B ?
  };
  </code></pre>