On 04/26/2014 07:05 AM, Nathan Ridge wrote:
Would something like
template <typename C> struct range_iterator
, C>::type> { ... }; work? This does not compile.
Well, it should be
template <typename C> struct range_iterator
::value, C>::type> { ... }; but an simpler example I tried also does not compile, complaining that template parameter C is not used (though it clearly is). I wonder if it's a bug in the error message (and the code is disallowed) or a real compiler bug. The code is disallowed. In order to select the partial specialization for some argument type 'A', the compiler would have to compare 'A' and 'typename enable_if
::value, C>::type' and deduce 'C'. It cannot do this (in standardese this is called a "non-deduced context").
Ok, thanks for the clarification.