From d4645ccd075af65337aeb00db0e53a6c45724c7c Mon Sep 17 00:00:00 2001 From: humesikkins Date: Sat, 8 Mar 2003 13:00:42 +0000 Subject: [PATCH] New transparent workaround for Field-Functions git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@119 7ec92016-0320-0410-acc4-a06ded1c099a --- MSVC/1200/HierarchyGenerators.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/MSVC/1200/HierarchyGenerators.h b/MSVC/1200/HierarchyGenerators.h index 27fff37..2dc2646 100644 --- a/MSVC/1200/HierarchyGenerators.h +++ b/MSVC/1200/HierarchyGenerators.h @@ -13,7 +13,7 @@ // without express or implied warranty. //////////////////////////////////////////////////////////////////////////////// -// Last update: Dec 08, 2002 +// Last update: Mar 08, 2003 #ifndef HIERARCHYGENERATORS_INC_ @@ -211,14 +211,14 @@ namespace Private //////////////////////////////////////////////////////////////////////////////// template typename ApplyInnerType::type& - Field(GenScatterHierarchy& obj) + Field(GenScatterHierarchy& obj,Type2Type* = (Type2Type*)0) { return obj; } template const typename ApplyInnerType::type& - Field(const GenScatterHierarchy& obj) + Field(const GenScatterHierarchy& obj, Type2Type* = (Type2Type*)0) { return obj; } @@ -372,6 +372,7 @@ namespace Private // returns a reference to Unit, where Unit is the template used to generate H // and T is the i-th type in the typelist //////////////////////////////////////////////////////////////////////////////// + /* template typename FieldHelper::template In,UnitWrapper>::ResultType& Field(GenScatterHierarchy& obj, Int2Type) @@ -379,7 +380,14 @@ namespace Private typedef typename GenScatterHierarchy H; return FieldHelper::template In::Do(obj, (int*)0); } - + */ + template + typename FieldHelper::template In,UnitWrapper>::ResultType& + Field(GenScatterHierarchy& obj, Int2Type* = (Int2Type*)0) + { + typedef typename GenScatterHierarchy H; + return FieldHelper::template In::Do(obj, (int*)0); + } //////////////////////////////////////////////////////////////////////////////// // class template GenLinearHierarchy // Generates a linear hierarchy starting from a typelist and a template @@ -487,7 +495,7 @@ namespace Private #if defined (_MSC_VER) && _MSC_VER <= 1300 #define FIELD(Obj, Nr) \ - Field(Obj, Int2Type()) + Field(Obj, (Int2Type*)0) #else #define FIELD(Obj, Nr) \ Field(Obj) @@ -505,6 +513,8 @@ namespace Private // work correctly due to the "Explicitly Specified Template // Functions Not Overloaded Correctly"-Bug // (Microsoft KB Article - 240871). B.K. +// Mar 08, 2003: New transparent workaround for Field-Functions. The FIELD-Macro +// is no longer needed. B.K. //////////////////////////////////////////////////////////////////////////////// #undef IS_TYPELIST #endif // HIERARCHYGENERATORS_INC_