title: How to declare a static constant member variable of a class that involves some simple calculations?
body: <p>I tried to have one static const member variable to relate to another static const variable in a class.
  The motivation is that if I need to modify one value later (when coding), i don't need to change all of those that are related to each other one by one. </p>
  
  <p>For example:</p>
  
  <pre><code>class Box
  {
      public:
          Box();
      private:
          static const double height = 10.0;
          static const double lid_height = 0.5 + height;
  };
  </code></pre>
  
  <p>It won't compile and the error was ''Box::height' cannot appear in a constant-expression'. So I guess you must type in the value of a static const member. But is there a way to have one member relate to another member variable of the same class, given that they will all be static const?? </p>