title: C++ derived types must define static constexpr
body: <p>Is there a way to force derived types to define a <code>static constexpr</code> in C++? I have a base class, and I want to force every derived class to define a <code>static const bool has_property</code>.</p>
  
  <p>I tried doing this with CRTP (so that each derived class gets its own <code>static const</code>):</p>
  
  <pre><code>template &lt;typename T, class MyClass&gt;
  struct Base {
      T data;
      static constexpr bool has_property;
  };
  
  template &lt;typename T&gt;
  struct Derived : public Base&lt;T, Derived&lt;T&gt; &gt; {
      static constexpr bool has_property = false;
  };
  </code></pre>
  
  <p>But the compiler complains that <code>Base::has_property</code> is not initialized.</p>
  
  <p>How can I accomplish this?</p>