Fix: Moved the new templates inside the Loki namespace

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@52 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
tslettebo 2002-09-29 13:49:41 +00:00
parent b79d2d799a
commit 1b82d40441

View file

@ -137,7 +137,6 @@ namespace Loki
public: public:
enum { exists = 1, exists2Way = 1, sameType = 1 }; enum { exists = 1, exists2Way = 1, sameType = 1 };
}; };
} // namespace Loki
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// class template SuperSubclass // class template SuperSubclass
@ -155,20 +154,6 @@ struct SuperSubclass
!::Loki::Conversion<const volatile T*, const volatile void*>::sameType) }; !::Loki::Conversion<const volatile T*, const volatile void*>::sameType) };
}; };
////////////////////////////////////////////////////////////////////////////////
// macro SUPERSUBCLASS
// Invocation: SUPERSUBCLASS(B, D) where B and D are types.
// Returns true if B is a public base of D, or if B and D are aliases of the
// same type.
//
// Caveat: might not work if T and U are in a private inheritance hierarchy.
// Deprecated: Use SuperSubclass class template instead.
////////////////////////////////////////////////////////////////////////////////
#define SUPERSUBCLASS(T, U) \
(::Loki::Conversion<const volatile U*, const volatile T*>::exists && \
!::Loki::Conversion<const volatile T*, const volatile void*>::sameType)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// class template SuperSubclassStrict // class template SuperSubclassStrict
// Invocation: SuperSubclassStrict<B, D>::value where B and D are types. // Invocation: SuperSubclassStrict<B, D>::value where B and D are types.
@ -185,6 +170,21 @@ struct SuperSubclassStrict
!::Loki::Conversion<const volatile T*, const volatile U*>::sameType) }; !::Loki::Conversion<const volatile T*, const volatile U*>::sameType) };
}; };
} // namespace Loki
////////////////////////////////////////////////////////////////////////////////
// macro SUPERSUBCLASS
// Invocation: SUPERSUBCLASS(B, D) where B and D are types.
// Returns true if B is a public base of D, or if B and D are aliases of the
// same type.
//
// Caveat: might not work if T and U are in a private inheritance hierarchy.
// Deprecated: Use SuperSubclass class template instead.
////////////////////////////////////////////////////////////////////////////////
#define SUPERSUBCLASS(T, U) \
::Loki::SuperSubclass<T,U>::value
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// macro SUPERSUBCLASS_STRICT // macro SUPERSUBCLASS_STRICT
// Invocation: SUPERSUBCLASS(B, D) where B and D are types. // Invocation: SUPERSUBCLASS(B, D) where B and D are types.
@ -195,8 +195,7 @@ struct SuperSubclassStrict
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#define SUPERSUBCLASS_STRICT(T, U) \ #define SUPERSUBCLASS_STRICT(T, U) \
(SUPERSUBCLASS(T, U) && \ ::Loki::SuperSubclassStrict<T,U>::value
!::Loki::Conversion<const volatile T*, const volatile U*>::sameType)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Change log: // Change log: