title: enum value as index of gsl::multi_span
body: <p>I'd like to use an <code>enum</code> to access elements in a <code>gsl::multi_span</code>. It works fine with <code>int</code>, so I thought it'd work with <code>enum</code> values as the underlying type is <code>int</code> too:</p>
  
  <pre><code>#include &lt;gsl/multi_span&gt;
  #include &lt;iostream&gt;
  
  int main(int argc, char *argv[]) {
    const auto NUMBER_OF_PARAMS{2};
    if (argc != NUMBER_OF_PARAMS) {
      return -1;
    }
  
    enum param_index { PROG_NAME = 0, PARAM1 };
    const auto args = gsl::multi_span&lt;char *&gt;(argv, argc);
  
    // compiles
    std::cout &lt;&lt; "Program name: " &lt;&lt; args[0] &lt;&lt; '\n';
    std::cout &lt;&lt; "Parameter: " &lt;&lt; args[1] &lt;&lt; '\n';
  
    // does not compile
    std::cout &lt;&lt; "Program name: " &lt;&lt; args[param_index::PROG_NAME] &lt;&lt; '\n';
    std::cout &lt;&lt; "Parameter: " &lt;&lt; args[param_index::PARAM1] &lt;&lt; '\n';
  }
  </code></pre>
  
  <p>GCC version 7 tells me:</p>
  
  <pre><code>src/so.cpp:16:40: error: no match for ‘operator[]’ (operand types are ‘const gsl::multi_span&lt;char*&gt;’ and ‘main(int, char**)::param_index’)
     std::cout &lt;&lt; "Program name: " &lt;&lt; args[param_index::PROG_NAME] &lt;&lt; '\n';
                                          ^
  In file included from src/so.cpp:1:0:
  ./GSL/include/gsl/multi_span:1494:25: note: candidate: constexpr gsl::multi_span&lt;ValueType, FirstDimension, RestDimensions&gt;::reference gsl::multi_span&lt;ValueType, FirstDimension, RestDimensions&gt;::operator[](const index_type&amp;) const [with ValueType = char*; long int FirstDimension = -1; long int ...RestDimensions = {}; gsl::multi_span&lt;ValueType, FirstDimension, RestDimensions&gt;::reference = char*&amp;; gsl::multi_span&lt;ValueType, FirstDimension, RestDimensions&gt;::index_type = gsl::index&lt;1&gt;]
       constexpr reference operator[](const index_type&amp; idx) const GSL_NOEXCEPT
                           ^~~~~~~~
  ./GSL/include/gsl/multi_span:1494:25: note:   no known conversion for argument 1 from ‘main(int, char**)::param_index’ to ‘const index_type&amp; {aka const gsl::index&lt;1&gt;&amp;}’
  ./GSL/include/gsl/multi_span:1500:19: note: candidate: template&lt;bool Enabled, class Ret&gt; constexpr Ret gsl::multi_span&lt;ValueType, FirstDimension, RestDimensions&gt;::operator[](gsl::multi_span&lt;ValueType, FirstDimension, RestDimensions&gt;::size_type) const [with bool Enabled = Enabled; Ret = Ret; ValueType = char*; long int FirstDimension = -1; long int ...RestDimensions = {}]
       constexpr Ret operator[](size_type idx) const GSL_NOEXCEPT
                     ^~~~~~~~
  ./GSL/include/gsl/multi_span:1500:19: note:   template argument deduction/substitution failed:
  </code></pre>
  
  <p>Could someone explain me why the template argument deduction fails in this case? Is there a workaround?</p>