From e6649f2d55acf4b3bca1ca275752961cd676a053 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 29 Jan 2008 23:31:04 +0000 Subject: [PATCH] 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 --- include/wx/meta/if.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/include/wx/meta/if.h b/include/wx/meta/if.h index 9b533a5ab1..450ef24bf1 100644 --- a/include/wx/meta/if.h +++ b/include/wx/meta/if.h @@ -32,8 +32,16 @@ struct wxIfImpl { template struct Result { - // intentionally don't define value here, this shouldn't be actually - // used, it's here just to work around a compiler bug + // unfortunately we also need to define value here because otherwise + // 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 @@ -45,7 +53,7 @@ struct wxIfImpl { template struct Result { - typedef TTrue value; + struct value : TTrue { }; }; }; @@ -55,7 +63,7 @@ struct wxIfImpl { template struct Result { - typedef TFalse value; + struct value : TFalse { }; }; }; @@ -67,8 +75,11 @@ struct wxIfImpl // // See wxVector in vector.h for usage example template -struct wxIf : wxPrivate::wxIfImpl::template Result +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::Result::value { }; }; #endif // _WX_META_IF_H_ -- 2.45.2