title: Accepting std::array of char of any size as non type template parameter
body: <p>This is probably a weird use case, but I am trying to hack around the fact string literals can not be used as arguments to templates using <code>std::array&lt;char, N&gt;</code> as non template type parameter.</p>
  <p>This works but with extreme limitation that all strings must be of same length(I could use <code>MAX_STR_LEN=100</code> or whatever and make all arrays that size, but that feels ugly...).</p>
  <p>Is there a way to make <a href="https://godbolt.org/z/4YYevM" rel="nofollow noreferrer">this code</a> work so that different size <code>std::array</code>s can be accepted as template parameter?</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;array&gt;
  #include &lt;tuple&gt;
  #include &lt;boost/mp11/algorithm.hpp&gt;
  #include &lt;boost/mp11/tuple.hpp&gt;
  // I wish that this 6 is not fixed... but IDK how to fix it, maybe concept(IDK if concepts can be used as &quot;types&quot; on NTTP.
  template &lt;typename Type, std::array&lt;char, 6&gt; val_val&gt;
  struct TypeToValues
  {
      using type = Type;
      static constexpr const char* val = val_val.data();
  };
  
  template &lt;std::size_t Sz, std::size_t... Is&gt;
  constexpr std::array&lt;char, Sz&gt;
      arrayify(const char (&amp;arr)[Sz], std::index_sequence&lt;Is...&gt;)
  {
      return {{arr[Is]...}};
  }
  
  template &lt;std::size_t Sz&gt;
  constexpr std::array&lt;char, Sz&gt; arrayify(const char (&amp;arr)[Sz])
  {
      return arrayify(arr, std::make_index_sequence&lt;Sz&gt;());
  }
  struct HelloType{
  
  };
  struct YoloType{
  
  };
  int main(){
      std::tuple&lt;
      TypeToValues&lt;HelloType, arrayify(&quot;Hello&quot;)&gt;,
      TypeToValues&lt;YoloType, arrayify(&quot;Yolo!&quot;)&gt;&gt; mapping;
      boost::mp11::tuple_for_each(mapping, []&lt;typename T&gt;(const T&amp;){
          if constexpr(std::is_same_v&lt;typename T::type, HelloType&gt;){
              std::cout &lt;&lt; &quot;HelloType says: &quot; &lt;&lt; T::val &lt;&lt; std::endl;;
          } 
          if constexpr(std::is_same_v&lt;typename T::type, YoloType&gt;){
              std::cout &lt;&lt; &quot;YoloType says: &quot; &lt;&lt; T::val &lt;&lt; std::endl;;
          }
      });
  
  }
  </code></pre>