title: initializer list as argument to operator[]
body: <p>This question is related to the one discussed <a href="https://stackoverflow.com/questions/2357452/stdinitializer-list-as-function-argument">here</a>.</p>
  
  <p>I try to use an initializer list to create an argument to be passed to <code>operator[]</code>.</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;vector&gt;
  
  struct A {
  
  std::string&amp; operator[](std::vector&lt;std::string&gt; vec)
  {
    return vec.front();
  }
  
  };
  
  int main()
  {
      // ok
      std::vector&lt;std::string&gt; vec {"hello", "world", "test"};
  
      A a;
      // error: could not convert '{"hello", "world", "test"}' to 'std::vector...'
      a[ {"hello", "world", "test"} ];
  }
  </code></pre>
  
  <p>My Compiler (GCC 4.6.1) complains:</p>
  
  <pre><code>g++ -std=c++0x test.cpp
  test.cpp: In function ‘int main()’:
  test.cpp:20:8: error: expected primary-expression before ‘{’ token
  test.cpp:20:8: error: expected ‘]’ before ‘{’ token
  test.cpp:20:8: error: expected ‘;’ before ‘{’ token
  test.cpp:20:35: error: expected primary-expression before ‘]’ token
  test.cpp:20:35: error: expected ‘;’ before ‘]’ token
  </code></pre>
  
  <p>Should this be valid C++11?</p>
  
  <p>Interestingly, when using <code>operator()</code> instead of <code>operator[]</code> it works.</p>