title: How to detect if operator[] applicable to Type?
body: <p>I would like to write function template like </p>
  
  <pre><code>template&lt; typename T &gt;
  void foo( T&amp; obj ){
      obj[0] = xxxxxx;
  }
  </code></pre>
  
  <p>where T must have operator[] applicable.<br>
  T may be array of any type, std::vector, std::array, or any other type. So, I cannot use T as superclass of all of them. I think it should be something like in <a href="http://en.cppreference.com/w/cpp/header/type_traits" rel="nofollow">std::type_traits</a> style.</p>