correct ParameterType
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@243 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
ac5f2fe935
commit
9cd0057667
3 changed files with 9 additions and 15 deletions
|
@ -98,17 +98,17 @@ namespace Loki
|
||||||
typedef NullType Result;
|
typedef NullType Result;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class U> struct AddConstReference
|
template <class U> struct AddParameterType
|
||||||
{
|
{
|
||||||
typedef const U & Result;
|
typedef const U & Result;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class U> struct AddConstReference<U &>
|
template <class U> struct AddParameterType<U &>
|
||||||
{
|
{
|
||||||
typedef const U & Result;
|
typedef U & Result;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <> struct AddConstReference<void>
|
template <> struct AddParameterType<void>
|
||||||
{
|
{
|
||||||
typedef NullType Result;
|
typedef NullType Result;
|
||||||
};
|
};
|
||||||
|
@ -2044,7 +2044,7 @@ namespace Loki
|
||||||
enum { result = true };
|
enum { result = true };
|
||||||
typedef U ReferredType;
|
typedef U ReferredType;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class U> struct PointerTraits
|
template <class U> struct PointerTraits
|
||||||
{
|
{
|
||||||
enum { result = false };
|
enum { result = false };
|
||||||
|
@ -2176,13 +2176,8 @@ namespace Loki
|
||||||
enum { isFundamental = isStdFundamental || isArith || isFloat };
|
enum { isFundamental = isStdFundamental || isArith || isFloat };
|
||||||
|
|
||||||
typedef typename Select<isStdArith || isPointer || isMemberPointer, T,
|
typedef typename Select<isStdArith || isPointer || isMemberPointer, T,
|
||||||
typename Private::AddReference<T>::Result>::Result
|
typename Private::AddParameterType<T>::Result>::Result
|
||||||
ParameterType;
|
ParameterType;
|
||||||
|
|
||||||
typedef typename Select<isStdArith || isPointer || isMemberPointer, T,
|
|
||||||
typename Private::AddConstReference<T>::Result>::Result
|
|
||||||
ConstParameterType;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,8 +104,8 @@ public:
|
||||||
SameType<TypeTraits<char>::ParameterType,char>::value &&
|
SameType<TypeTraits<char>::ParameterType,char>::value &&
|
||||||
SameType<TypeTraits<int>::ParameterType,int>::value &&
|
SameType<TypeTraits<int>::ParameterType,int>::value &&
|
||||||
SameType<TypeTraits<double>::ParameterType,double>::value &&
|
SameType<TypeTraits<double>::ParameterType,double>::value &&
|
||||||
SameType<TypeTraits<Test>::ParameterType,Test &>::value &&
|
SameType<TypeTraits<Test&>::ParameterType,Test &>::value &&
|
||||||
SameType<TypeTraits<Test>::ConstParameterType,const Test &>::value;
|
SameType<TypeTraits<Test>::ParameterType,const Test &>::value;
|
||||||
|
|
||||||
testAssert("TypeTraits",r,result);
|
testAssert("TypeTraits",r,result);
|
||||||
|
|
||||||
|
|
|
@ -507,8 +507,7 @@ inline void TypeTraitsTest2::testParameterType()
|
||||||
TEST_TYPE(const volatile A, const volatile A&);
|
TEST_TYPE(const volatile A, const volatile A&);
|
||||||
TEST_TYPE(A&, A&);
|
TEST_TYPE(A&, A&);
|
||||||
|
|
||||||
//TEST_TYPE(A, const A&); use ConstParameterType
|
TEST_TYPE(A, const A&);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void TypeTraitsTest2::testReferredType()
|
inline void TypeTraitsTest2::testReferredType()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue