From a290ef01b1953d3101c2eb78e4cfff64a4c5b21e Mon Sep 17 00:00:00 2001 From: syntheticpp Date: Thu, 15 Sep 2005 17:51:09 +0000 Subject: [PATCH] fix typetraits bug thanks to Kalle Rutanen git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@237 7ec92016-0320-0410-acc4-a06ded1c099a --- include/loki/TypeTraits.h | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/include/loki/TypeTraits.h b/include/loki/TypeTraits.h index bd8df13..70867b2 100644 --- a/include/loki/TypeTraits.h +++ b/include/loki/TypeTraits.h @@ -159,6 +159,12 @@ namespace Loki typedef U PointeeType; }; + template struct PointerTraits + { + enum { result = true }; + typedef U PointeeType; + }; + template struct ReferenceTraits { enum { result = false }; @@ -180,7 +186,12 @@ namespace Loki { enum { result = true }; }; - + + template struct PToMTraits + { + enum { result = true }; + }; + template struct UnConst { typedef U Result; @@ -198,13 +209,7 @@ namespace Loki typedef U& Result; enum { isConst = 1 }; }; - - template struct UnConst - { - typedef U V::* Result; - enum { isConst = 1 }; - }; - + template struct UnVolatile { typedef U Result; @@ -223,13 +228,7 @@ namespace Loki enum { isVolatile = 1 }; }; - template struct UnVolatile - { - typedef U V::* Result; - enum { isVolatile = 1 }; - }; - - + public: typedef typename UnConst::Result NonConstType; @@ -237,7 +236,7 @@ namespace Loki NonVolatileType; typedef typename UnVolatile::Result>::Result UnqualifiedType; - typedef typename PointerTraits::PointeeType + typedef typename PointerTraits::PointeeType PointeeType; typedef typename ReferenceTraits::ReferredType ReferredType;