Hi,
this is a cut down version of some some template
meta stuff that I have:
///////////////////////////////////////////////////////
template< typename TL, typename TR >
struct Dummy1 {};
template< typename TL, typename TR
, template<typename,typename> class TDummy >
struct Operation;
template< typename TL1, typename TL2
, typename TR
, template<typename,typename> class TDummy >
struct Operation< TDummy<TL1,TL2>
, TR
, TDummy > {
typedef TDummy<TL1,TL1> Result;
};
template< typename TL1, typename TL2
, typename TR1, typename TR2
, template<typename,typename> class TDummy >
struct Operation< TDummy<TL1,TL2>
, TDummy<TR1,TR2>
, TDummy > {
typedef TDummy<TL1,TL1> Result;
};
typedef Dummy1<int ,float > T1A;
typedef Dummy1<long,double> T1B;
typedef Operation< T1A , T1B , Dummy1 >::Result T3;
///////////////////////////////////////////////////////
Comeau and CodeWarrior 9 agree with me that this code
is fine. VC7.1, however, barks at me:
test.cpp(29) : error C2752: 'Operation<TL,TR,TDummy>' :
more than one partial specialization matches the template argument list
test.cpp(24): could be 'Operation< TDummy<TL1,TL2>, TDummy<TR1,TR2>, TDummy >'
test.cpp(15): or 'Operation< TDummy<TL1,TL2>, TR, TDummy >'
I think this is a bug in VC7.1.
I cannot currently test this with VC8.
Schobi

Signature
SpamTrap@gmx.de is never read
I'm Schobi at suespammers dot org
"The presence of those seeking the truth is infinitely
to be prefered to those thinking they've found it."
Terry Pratchett
Carl Daniel [VC++ MVP] - 23 Feb 2005 15:27 GMT
> I think this is a bug in VC7.1.
I think you're right, but I haven't spent the time to really argue that
case.
> I cannot currently test this with VC8.
VC8 (Beta 1 Refresh) produces the same error messages as 7.1.
-cd
Hendrik Schober - 23 Feb 2005 19:38 GMT
> > I think this is a bug in VC7.1.
>
[quoted text clipped - 4 lines]
>
> VC8 (Beta 1 Refresh) produces the same error messages as 7.1.
Interestingly, GCC agrees with VC here. (Which
is rather rare IME. <g> )
Nevertheless, due to experience I tend to trust
Comeau and CW over VC and GCC.
> -cd
Schobi

Signature
SpamTrap@gmx.de is never read
I'm Schobi at suespammers dot org
"The presence of those seeking the truth is infinitely
to be prefered to those thinking they've found it."
Terry Pratchett
Tom Widmer - 24 Feb 2005 10:18 GMT
>>>I think this is a bug in VC7.1.
>>
[quoted text clipped - 9 lines]
> Nevertheless, due to experience I tend to trust
> Comeau and CW over VC and GCC.
Yes, Comeau and CW are correct. The second partial specialization is
clearly more specialized than the first (you can synthesize types from
the first that the second can't match but not vice versa).
Tom
Hendrik Schober - 24 Feb 2005 20:22 GMT
> [...]
> Yes, Comeau and CW are correct. The second partial specialization is
> clearly more specialized than the first (you can synthesize types from
> the first that the second can't match but not vice versa).
Thanks, Tom. That's what I figured, although
I couldn't word it as good as you. :)
I should report this then.
> Tom
Schobi

Signature
SpamTrap@gmx.de is never read
I'm Schobi at suespammers dot org
"The presence of those seeking the truth is infinitely
to be prefered to those thinking they've found it."
Terry Pratchett