http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56506

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> 
2013-03-03 19:46:42 UTC ---
I don't think that either example should be accepted. My understanding is, that
the second T is still considered as a parameter pack but not as an expansion
(because it is not followed by ...) at the time of pattern match checking,
therefore the compiler would try to match a sequence of expansions from the
first T... with a corresponding parameter pack. But this pack is always
considered as a different type, even if it would contain the same single type
(e.g. consider an argument type Y<Z<int>, int> where we would try to match
'int' with '[int]' where I use square brackets to denote the still existing
pack). So both cannot be the same type, and this specialization can never be
found. It would work, if you would declare the partial specialization as:

template<typename... T, typename... U>  
struct X<Y<Z<T...>, U>...> 
{
  typedef int type;
};

because now the compiler don't needs to cross-match corresponding T expansions
with the U pack.

I understand that this is a somewhat more generous specialization as you would
like to have, though.

Reply via email to