title: C++ passing const value of derived class to constructor of base unexpected behavior
body: <p>I assume this is fairly basic, but I couldn't find any source here.</p>
  
  <p>A derived class contains initialization information which needs to be passed to the base class. In this case it is a memory reservation. </p>
  
  <pre><code>class Derived: public Base
  {
  private:
    const unsigned short memorySize= 100;    
  public:  
    inline Derived() : Base(memorySize) {}
    void DoStuff();
  };
  </code></pre>
  
  <p>This fails miserably. I expect the base constructor is called before the derived constructor, and memorySize is only assigned when the derived constructor is being called. </p>
  
  <pre><code>#define memorySize 100
  
  class Derived: public Base
  {
  private:
  
  public:  
    inline Derived() : Base(memorySize) {}
    void DoStuff();
  };
  </code></pre>
  
  <p>This works as expected. </p>
  
  <p>My questions: 
  Is my assumption that memorySize in the first example has not yet been initialized at the time the base constructor is being called, or is something else happening here?</p>
  
  <p>I have learned that #define for constants are undesirable in C++, and it's highly preferable to use const values. Is this an exception to this rule, or is there a more proper way to deal with this situation?</p>