title: static std::array with structs containing std::string
body: <p>I am trying to create a Look-Up Table for easy creation of objects with different values. For this I need a static std::array in my class filled with the data.
  It currently looks like this:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  #include &lt;array&gt;
  #include &lt;string&gt;
  
  struct MyStruct{
      std::string s;
      int a;
      int b;
  };
  
  class Arr{
  public:
      static constexpr std::array&lt;MyStruct, 3&gt; strArray{{{"a", 1,2}, {"b", 2,3}, {"c", 3,4}}};
  };
  
  constexpr std::array&lt;MyStruct, 3&gt; Arr::strArray;
  
  int main()
  {    
      for(auto i : Arr::a){
          std::cout &lt;&lt; i &lt;&lt; std::endl;
      }
  
      std::cout &lt;&lt; "With a struct:\n";
      for(auto i : Arr::strArray){
          std::cout &lt;&lt; i.a &lt;&lt; ", " &lt;&lt; i.b &lt;&lt; std::endl;
      }
  
  
  
      return 0;
  }
  </code></pre>
  
  <p>It works fine, if I remove the std::string, but with the std::string I get the compile error</p>
  
  <pre class="lang-none prettyprint-override"><code>../staticArray/main.cpp:15:46: error: constexpr variable cannot have non-literal type 'const std::array&lt;MyStruct, 3&gt;'
      static constexpr std::array&lt;MyStruct, 3&gt; strArray{{{"a", 1,2}, {"b", 2,3}, {"c", 3,4}}};
                                               ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/array:137:16: note: 'array&lt;MyStruct, 3&gt;' is not literal because it has data member '__elems_' of non-literal type 'value_type [3]'
      value_type __elems_[_Size &gt; 0 ? _Size : 1];
                 ^
  ../staticArray/main.cpp:19:40: error: constexpr variable cannot have non-literal type 'const std::array&lt;MyStruct, 3&gt;'
  constexpr std::array&lt;MyStruct, 3&gt; Arr::strArray;
                                         ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/array:137:16: note: 'array&lt;MyStruct, 3&gt;' is not literal because it has data member '__elems_' of non-literal type 'value_type [3]'
      value_type __elems_[_Size &gt; 0 ? _Size : 1];
  </code></pre>