title: type signature of an enable_if'ed templated template constructor?
body: <p>I usually declare my classes and templates, and then define their methods after (in the same header file, of course). I just find it easier to read that way. Well, I've come across a case where I can't figure out a working type signature to use in an out-of-class definition. Here's a simplified example of what I'm doing, that illustrates the problem:</p>
  
  <pre><code>template &lt;class T&gt;
  struct Foo
    {
      Foo(T a, T b);
  
      template 
        &lt; class Iterator
        , enable_if&lt; is_iterator&lt;Iterator&gt; &gt;
        &gt;
      Foo
        ( Iterator first
        , Iterator last
        );
    };
  
  template &lt;class T&gt;
  Foo&lt;T&gt;::Foo(T a, T b)
  { ... }
  
  template &lt;class T&gt;
  template
    &lt; class U
    , WHAT_GOES_HERE?
    &gt;
  Foo&lt;T&gt;::Foo(U f, U l)
  { ... }
  </code></pre>
  
  <p>I have tried a number of things in the <code>WHAT_GOES_HERE</code> slot to try to get a matching signature, and I keep failing. I need the enable_if to distinguish the case where one passes in two objects of type T, and when one passes in a pair of Iterators. The code works fine if the templated constructor is defined inside the main template, which is how the code currently does it, but I'd much rather move the definition outside the declaration.</p>
  
  <p><strong>EDIT:</strong> I should mention that I can't just re-use enable_if&lt;...> in the definition, because enable_if&lt;...> assigns a default value for its type, which you cannot do in a definition that isn't also a declaration.</p>