diff --git a/MSVC/1200/DataGenerators.h b/MSVC/1200/DataGenerators.h index 2c67977..47aa0f6 100644 --- a/MSVC/1200/DataGenerators.h +++ b/MSVC/1200/DataGenerators.h @@ -82,6 +82,8 @@ namespace Private head.operator()(ii); tail.operator()(ii); } + protected: + ~In() {} }; }; @@ -100,6 +102,8 @@ namespace Private *ii = genfunc(); ++ii; //Is this even needed? } + protected: + ~In() {} }; }; @@ -113,6 +117,8 @@ namespace Private template void operator()(II ii) {} + protected: + ~In() {} }; }; } // end ns Private @@ -140,4 +146,5 @@ namespace Private // 9/20/02 Named changed from GenData to IterateTypes // 10/8/02 insertion iterators are passed-by-value, not by-reference (oops) // 03/04/03 ported by Benjamin Kaufmann to MSVC 6.0 +// 03/06/03 added protected destructors to private implementation classes B.K. //////////////////////////////////////////////////////////////////////////////// diff --git a/MSVC/1200/Functor.h b/MSVC/1200/Functor.h index d3cbd80..50b720f 100644 --- a/MSVC/1200/Functor.h +++ b/MSVC/1200/Functor.h @@ -743,7 +743,8 @@ namespace Private return f_(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15); } - + protected: + ~FunctorHandlerBase() {} private: Fun f_; }; @@ -844,7 +845,8 @@ namespace Private f_(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15); } - + protected: + ~FunctorHandlerVoidBase() {} private: Fun f_; }; @@ -1007,7 +1009,9 @@ namespace Private p11, p12, p13, p14, p15); } - private: + protected: + ~MemFunHandlerBase() {} + private: PointerToObj pObj_; PointerToMemFn pMemFn_; }; @@ -1118,7 +1122,8 @@ namespace Private ((*pObj_).*pMemFn_)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15); } - + protected: + ~MemFunHandlerVoidBase() {} private: PointerToObj pObj_; PointerToMemFn pMemFn_; @@ -1306,6 +1311,7 @@ namespace Private } protected: std::auto_ptr spImpl_; + ~FunctorBase() {} }; // implementation class for Functor with return type = void @@ -1426,6 +1432,7 @@ namespace Private } protected: std::auto_ptr spImpl_; + ~FunctorVoidBase() {} }; } @@ -1765,8 +1772,8 @@ namespace Private p14); } - // VC7 BUG - virtual ~BinderFirstBase() {} + protected: + ~BinderFirstBase() {} private: OriginalFunctor f_; BoundType b_; @@ -1860,8 +1867,8 @@ namespace Private p14); } - // VC7 BUG - virtual ~BinderFirstVoidBase() {} + protected: + ~BinderFirstVoidBase() {} private: OriginalFunctor f_; BoundType b_; @@ -1998,12 +2005,7 @@ namespace Private ChainerBase(const Fun1& fun1, const Fun2& fun2) : f1_(fun1), f2_(fun2) {} - // - // VC7 don't see this implicit constructor - // - - virtual ~ChainerBase() {} - + // operator() implementations for up to 15 arguments ResultType operator()() @@ -2102,6 +2104,7 @@ namespace Private protected: Fun1 f1_; Fun2 f2_; + ~ChainerBase() {} }; @@ -2132,12 +2135,6 @@ namespace Private ChainerVoidBase(const Fun1& fun1, const Fun2& fun2) : f1_(fun1), f2_(fun2) {} - // - // VC7 don't see this implicit constructor - // - - virtual ~ChainerVoidBase() {} - // operator() implementations for up to 15 arguments ResultType operator()() @@ -2236,7 +2233,7 @@ namespace Private protected: Fun1 f1_; Fun2 f2_; - + ~ChainerVoidBase() {} }; } //////////////////////////////////////////////////////////////////////////////// @@ -2329,6 +2326,7 @@ namespace Private // Replaced the void return workaround. // B.K. // Feb 25, 2003: added conversion unspecified_bool_type. B.K. +// Mar 06, 2003: added protected destructors to private implementation classes B.K. //////////////////////////////////////////////////////////////////////////////// #endif // FUNCTOR_INC_ #endif // #ifdef USE_FUNCTOR_OLD_VERSION \ No newline at end of file diff --git a/MSVC/1200/MultiMethods.h b/MSVC/1200/MultiMethods.h index 8eafedc..a21dff6 100644 --- a/MSVC/1200/MultiMethods.h +++ b/MSVC/1200/MultiMethods.h @@ -137,6 +137,8 @@ namespace Private return DispatchLhs(lhs, rhs, exec, Tail()); } + protected: + ~StaticDispatcherBase() {} public: static ResultType Go( BaseLhs& lhs, BaseRhs& rhs, Executor exec) @@ -189,6 +191,8 @@ namespace Private DispatchLhs(lhs, rhs, exec, Tail()); } + protected: + ~StaticDispatcherVoidBase() {} public: static ResultType Go( BaseLhs& lhs, BaseRhs& rhs, Executor exec) @@ -209,8 +213,7 @@ namespace Private bool symmetric = true, class BaseRhs = BaseLhs, class TypesRhs = TypesLhs, - typename ResultType = Loki::Select< - Loki::Private::AlwaysFalse::value, void, void>::Result + typename ResultType = Loki::Private::VoidWrap::type > class StaticDispatcher : public ::Loki::Select < @@ -255,6 +258,7 @@ namespace Private typedef CallbackType MappedType; typedef AssocVector MapType; MapType callbackMap_; + ~BasicDispatcherCommonBase() {} public: template void Add(CallbackType fun, ::Loki::Type2Type, @@ -295,6 +299,8 @@ namespace Private typedef BasicDispatcherCommonBase Base; ResultType Go(BaseLhs& lhs, BaseRhs& rhs); + protected: + ~BasicDispatcherBase() {} }; template @@ -320,6 +326,8 @@ namespace Private typedef BasicDispatcherCommonBase Base; ResultType Go(BaseLhs& lhs, BaseRhs& rhs); + protected: + ~BasicDispatcherVoidBase() {} }; template typename BasicDispatcherVoidBase::ResultType @@ -346,8 +354,7 @@ namespace Private < class BaseLhs, class BaseRhs = BaseLhs, - typename ResultType = Loki::Select< - Loki::Private::AlwaysFalse::value, void, void>::Result, + typename ResultType = Loki::Private::VoidWrap::type, typename CallbackType = ResultType (*)(BaseLhs&, BaseRhs&) > class BasicDispatcher : public ::Loki::Select @@ -440,6 +447,8 @@ namespace Private { return backEnd_.Go(lhs, rhs); } + protected: + ~FnDispatcherBase() {} }; template @@ -453,6 +462,8 @@ namespace Private { backEnd_.Go(lhs, rhs); } + protected: + ~FnDispatcherVoidBase() {} }; @@ -470,6 +481,8 @@ namespace Private { Trampoline(lhs, rhs); } + protected: + ~FnDispatcherHelperVoidBase() {} }; template::value, void, void>::Result, + typename ResultType = Loki::Private::VoidWrap::type, class CastingPolicy = DynamicCasterWrapper, class DispatcherBackend = BasicDispatcherWrapper> class FnDispatcher : public ::Loki::Select @@ -657,6 +671,7 @@ namespace Private ApplyInnerType4::type backEnd_; + ~FunctorDispatcherCommonBase() {} }; template @@ -691,7 +708,8 @@ namespace Private { Base::backEnd_.Go(lhs, rhs); } - + protected: + ~FunctorDispatcherVoidBase() {} }; } @@ -702,8 +720,7 @@ namespace Private //////////////////////////////////////////////////////////////////////////////// template ::value, void, void>::Result, + typename ResultType = Loki::Private::VoidWrap::type, class CastingPolicy = DynamicCasterWrapper, class DispatcherBackend = BasicDispatcherWrapper> class FunctorDispatcher : public ::Loki::Select @@ -784,7 +801,8 @@ namespace Private // Oct 28, 2002: ported by Benjamin Kaufmann to MSVC 6 // Feb 19, 2003: replaced pointer-Dummies with Type2Type-Parameters and added // support for return type void. B.K. -// Mar 06, 2003: Changed default values for return types to void B.K. +// Mar 06, 2003: Changed default values for return types to void. +// Added protected destructors to private implementation classes B.K. //////////////////////////////////////////////////////////////////////////////// #endif diff --git a/MSVC/1200/Visitor.h b/MSVC/1200/Visitor.h index 1e46f6f..d39747f 100644 --- a/MSVC/1200/Visitor.h +++ b/MSVC/1200/Visitor.h @@ -260,6 +260,8 @@ namespace Private ASSERT_TYPELIST(TList); virtual R Visit(typename TList::Head&) { return R(); } + protected: + ~BaseVisitorImplBase() {} }; template @@ -270,6 +272,8 @@ namespace Private ASSERT_TYPELIST(TList); virtual R Visit(typename TList::Head&) { } + protected: + ~BaseVisitorImplVoidBase() {} }; } @@ -292,10 +296,6 @@ namespace Private //////////////////////////////////////////////////////////////////////////////// // class template DefaultCatchAll //////////////////////////////////////////////////////////////////////////////// -namespace Private -{ - -} template struct DefaultCatchAll { @@ -376,36 +376,39 @@ namespace Private class BaseVisitableBase { typedef R ReturnType; - protected: - template - static ReturnType AcceptImpl(T& visited, BaseVisitor& guest) + protected: + template + static ReturnType AcceptImpl(T& visited, BaseVisitor& guest) + { + typedef ApplyInnerType2::type CatchA; + // Apply the Acyclic Visitor + if (Visitor* p = dynamic_cast*>(&guest)) { - typedef ApplyInnerType2::type CatchA; - // Apply the Acyclic Visitor - if (Visitor* p = dynamic_cast*>(&guest)) - { - return p->Visit(visited); - } - return CatchA::OnUnknownVisitor(visited, guest); + return p->Visit(visited); } + return CatchA::OnUnknownVisitor(visited, guest); + } + ~BaseVisitableBase() {} + }; template class BaseVisitableVoidBase { typedef R ReturnType; - protected: - template - static ReturnType AcceptImpl(T& visited, BaseVisitor& guest) + protected: + template + static ReturnType AcceptImpl(T& visited, BaseVisitor& guest) + { + typedef ApplyInnerType2::type CatchA; + // Apply the Acyclic Visitor + if (Visitor* p = dynamic_cast*>(&guest)) { - typedef ApplyInnerType2::type CatchA; - // Apply the Acyclic Visitor - if (Visitor* p = dynamic_cast*>(&guest)) - { - p->Visit(visited); - return; - } - CatchA::OnUnknownVisitor(visited, guest); + p->Visit(visited); + return; } + CatchA::OnUnknownVisitor(visited, guest); + } + ~BaseVisitableVoidBase() {} }; } template @@ -456,6 +459,8 @@ namespace Private Visitor& subObj = *this; return subObj.Visit(host); } + protected: + ~CyclicVisitorBase() {} }; template class CyclicVisitorVoidBase : public Visitor @@ -467,6 +472,8 @@ namespace Private Visitor& subObj = *this; subObj.Visit(host); } + protected: + ~CyclicVisitorVoidBase() {} }; } @@ -505,7 +512,8 @@ namespace Private // Oct 27, 2002: ported by Benjamin Kaufmann to MSVC 6.0 // Feb 23, 2003: Removed special visitor classes for return type void. // Added Loki:: qualification to Accept's Paramter (in the macro) B.K. -// Mar 06, 2003: Changed default values for return types to void B.K. +// Mar 06, 2003: Changed default values for return types to void. +// Added protected destructors to private implementation classes B.K. //////////////////////////////////////////////////////////////////////////////// #endif // VISITOR_INC_