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;
|
||||
};
|
||||
|
||||
template <class U> struct AddConstReference
|
||||
template <class U> struct AddParameterType
|
||||
{
|
||||
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;
|
||||
};
|
||||
|
@ -2176,13 +2176,8 @@ namespace Loki
|
|||
enum { isFundamental = isStdFundamental || isArith || isFloat };
|
||||
|
||||
typedef typename Select<isStdArith || isPointer || isMemberPointer, T,
|
||||
typename Private::AddReference<T>::Result>::Result
|
||||
typename Private::AddParameterType<T>::Result>::Result
|
||||
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<int>::ParameterType,int>::value &&
|
||||
SameType<TypeTraits<double>::ParameterType,double>::value &&
|
||||
SameType<TypeTraits<Test>::ParameterType,Test &>::value &&
|
||||
SameType<TypeTraits<Test>::ConstParameterType,const Test &>::value;
|
||||
SameType<TypeTraits<Test&>::ParameterType,Test &>::value &&
|
||||
SameType<TypeTraits<Test>::ParameterType,const Test &>::value;
|
||||
|
||||
testAssert("TypeTraits",r,result);
|
||||
|
||||
|
|
|
@ -507,8 +507,7 @@ inline void TypeTraitsTest2::testParameterType()
|
|||
TEST_TYPE(const volatile A, const volatile A&);
|
||||
TEST_TYPE(A&, A&);
|
||||
|
||||
//TEST_TYPE(A, const A&); use ConstParameterType
|
||||
|
||||
TEST_TYPE(A, const A&);
|
||||
}
|
||||
|
||||
inline void TypeTraitsTest2::testReferredType()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue