Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 5
    constexpr isn't part of the type system. It's part of the expression system, i.e. of the nature of values. Commented May 29, 2016 at 0:33
  • @KerrekSB I discovered that the hard way Commented May 29, 2016 at 0:34
  • 3
    using a non constexpr version would not make any sense How does a constexpr version make sense? What do you expect it to do? Commented May 29, 2016 at 0:35
  • @deviantfan I have designed a class specifically for compile time strings...if I wanted to use the non-constexpr version I was probably trying to use a normal string or I just forgot to type it out.....I am wondering if there is any way to avoid this mistake Commented May 29, 2016 at 0:37
  • @DarthRubik: "if I wanted to use the non-constexpr version I was probably trying to use a normal string" Why? A static string would presumably not allocate heap space. That sounds like a good reason to want to use one even at runtime, where reasonable. Commented May 29, 2016 at 1:05