title: Using a lambda in place of an index-able template parameter
body: <p>I have a method that takes an index-able object as a template parameter, something like:</p>
  
  <pre><code>template &lt;typename OBJ&gt;
  int foo(int n, OBJ o)
  {
    int x = 0;
    for (int i = 0; i &lt; n; ++i) {
      x += o[i];
    }
    return x;
  }
  </code></pre>
  
  <p>Is there a way I can pass a lambda function in for the <code>o</code> parameter? In other words, having the lambda be call-able via the <code>[]</code> operator rather than the <code>()</code> operator?</p>