title: Specializing templated function for a templated type?
body: <p>I've got a function:</p>
  
  <pre><code>// declaration of random, specialize this to provide random instances of types
  template &lt;typename T&gt; T random() {
      static_assert(
          std::is_void&lt;T&gt;::value &amp;&amp; false, "random() not implemented for type"
      );
  }
  </code></pre>
  
  <p>I'd like to specialize it for another type, _point1d that's also templated:</p>
  
  <pre><code>template &lt;typename T&gt;
  struct _point1d {
      _point1d(T x) : x(x) {}
      T x;
  };
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>template &lt;typename T&gt;
  _point1d&lt;T&gt; random&lt;_point1d&lt;T&gt;&gt;() { return _point1d&lt;T&gt;(random&lt;T&gt;()); }
  </code></pre>
  
  <p>But I get:</p>
  
  <pre><code>error: non-type partial specialization ‘random&lt;_point1d&lt;T&gt; &gt;’ is not allowed
  </code></pre>
  
  <p>With gcc.  Is this possible?</p>