title: C++ const reference template function argument type is itself a reference, why?
body: <p>I have the following function:</p>
  <pre><code>template&lt;typename T&gt;
  void f(const T&amp; val) {
      using value_type = T;
      using sub_type = typename value_type::sub_type;
      //etc...
  }
  </code></pre>
  <p>However, I am running into the problem that the compiler is telling me that T is not fact whatever type it is, but instead a reference to it. How is that possible, in what circumstances are template parameter for const-references themselves references?</p>
  <p>Note, I can work around the above issue with:</p>
  <pre><code>    using value_type = std::remove_reference_t&lt;T&gt;;
  </code></pre>
  <p>but I'd like to understand what circumstances T, itself, would be a reference.</p>