title: When are constexpr objects constructed?
body: <p>When are <code>constexpr</code> objects constructed relative to non-<code>constexpr</code> non-local objects with static storage duration? Do they start their life prior to initialization of any other objects, i.e., prior to dynamic initialization?</p>
  
  <p>I'm contemplating whether it would be reasonable to have a <a href="http://ideone.com/Vs1VCh"><code>string_literal</code> class (live example)</a> which is used, e.g., to compare <code>std::string</code>s against certain keywords:</p>
  
  <pre><code>class string_literal
  {
      // private members
  public:
      constexpr string_literal(char const* b);
      bool operator== (std::string const&amp; other) const;
      bool operator!= (std::string const&amp; other) const;
      // other member functions
  };
  
  constexpr string_literal hello("hello");
  void f(std::string const&amp; s) {
      if (s == hello) {
          // do something
      }
  }
  </code></pre>
  
  <p>Since the <code>string_literal</code> could parse the string-literal at compile-time to locate the first null-character, I could imagine that these comparisons can be made faster than comparing a <code>std::string</code> against a string-literal. However, to be safe it is necessary that the <code>hello</code> object is readily constructed when the first constructor is executed at run-time during static initialization: otherwise these objects could be accidentally accessed when they are not, yet, constructed.</p>