H
Hendrik Schober
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
--
(e-mail address removed) 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
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
--
(e-mail address removed) 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