more VC6 fixes: nested value must be real classes, not typedefs; skeleton declaration must contain value as well

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51452 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-01-29 23:31:04 +00:00
parent 52e5cc357e
commit e6649f2d55

View File

@@ -32,8 +32,16 @@ struct wxIfImpl
{ {
template<typename TTrue, typename TFalse> struct Result template<typename TTrue, typename TFalse> struct Result
{ {
// intentionally don't define value here, this shouldn't be actually // unfortunately we also need to define value here because otherwise
// used, it's here just to work around a compiler bug // Result::value is not recognized as a class neither and it has to be
// complete too -- at least make it unusable because it really, really
// should never be used
class value
{
private:
value();
~value();
};
}; };
} }
#endif // VC++ <= 6 #endif // VC++ <= 6
@@ -45,7 +53,7 @@ struct wxIfImpl<true>
{ {
template<typename TTrue, typename TFalse> struct Result template<typename TTrue, typename TFalse> struct Result
{ {
typedef TTrue value; struct value : TTrue { };
}; };
}; };
@@ -55,7 +63,7 @@ struct wxIfImpl<false>
{ {
template<typename TTrue, typename TFalse> struct Result template<typename TTrue, typename TFalse> struct Result
{ {
typedef TFalse value; struct value : TFalse { };
}; };
}; };
@@ -67,8 +75,11 @@ struct wxIfImpl<false>
// //
// See wxVector<T> in vector.h for usage example // See wxVector<T> in vector.h for usage example
template<bool Cond, typename TTrue, typename TFalse> template<bool Cond, typename TTrue, typename TFalse>
struct wxIf : wxPrivate::wxIfImpl<Cond>::template Result<TTrue, TFalse> struct wxIf
{ {
// notice that value can't be a typedef, VC6 refuses to use it as a base
// class in this case
struct value : wxPrivate::wxIfImpl<Cond>::Result<TTrue, TFalse>::value { };
}; };
#endif // _WX_META_IF_H_ #endif // _WX_META_IF_H_