title: How does a function call give a compile-time type?
body: <pre><code>#include &lt;range/v3/all.hpp&gt;
  
  using namespace ranges;
  
  template&lt;typename I, typename O&gt;
  tagged_pair&lt;tag::in(I), tag::out(O)&gt;
  f(I i, O o)
  {
      return { i, o };
  }
  
  int main()
  {
      char buf[8]{};
      f(std::begin(buf), std::end(buf));
  }
  </code></pre>
  
  <p>The code uses <a href="https://github.com/ericniebler/range-v3" rel="nofollow noreferrer">range-v3</a> and can be compiled with <code>clang</code>. </p>
  
  <p>However, I cannot understand why the line <code>tagged_pair&lt;tag::in(I), tag::out(O)&gt;</code> is legal. <code>I</code> is a type, <code>tag::in(I)</code> is also a type, and <code>tag::in</code> is not a macro, how does <code>tag::in(I)</code> give a type at compile-time?</p>
  
  <p>See also <a href="http://en.cppreference.com/w/cpp/experimental/ranges/algorithm/copy" rel="nofollow noreferrer">http://en.cppreference.com/w/cpp/experimental/ranges/algorithm/copy</a></p>