type_traits: Implement is_pointer, remove_pointer, and add_pointer; reformat.
2004-12-12 Paolo Carlini <pcarlini@suse.de> * include/tr1/type_traits: Implement is_pointer, remove_pointer, and add_pointer; reformat. (_DEFINE_PRIMARY_SPEC_HELPER, _DEFINE_PRIMARY_SPEC): Generalize and rename to _DEFINE_SPEC_HELPER and _DEFINE_SPEC; update uses. * testsuite/tr1/4_metaprogramming/pointer_modifications/ add_pointer.cc: New. * testsuite/tr1/4_metaprogramming/pointer_modifications/ remove_pointer.cc: Likewise. * testsuite/tr1/4_metaprogramming/primary_type_categories/ is_pointer/is_pointer.cc: Likewise. * testsuite/tr1/4_metaprogramming/primary_type_categories/ is_pointer/typedefs.cc: Likewise. * testsuite/tr1/4_metaprogramming/primary_type_categories/ is_reference/is_reference.cc: Slightly tweak consistently. From-SVN: r92047
This commit is contained in:
parent
8a40280df9
commit
e192ab01d0
|
@ -1,3 +1,21 @@
|
||||||
|
2004-12-12 Paolo Carlini <pcarlini@suse.de>
|
||||||
|
|
||||||
|
* include/tr1/type_traits: Implement is_pointer, remove_pointer,
|
||||||
|
and add_pointer; reformat.
|
||||||
|
(_DEFINE_PRIMARY_SPEC_HELPER, _DEFINE_PRIMARY_SPEC): Generalize
|
||||||
|
and rename to _DEFINE_SPEC_HELPER and _DEFINE_SPEC; update uses.
|
||||||
|
* testsuite/tr1/4_metaprogramming/pointer_modifications/
|
||||||
|
add_pointer.cc: New.
|
||||||
|
* testsuite/tr1/4_metaprogramming/pointer_modifications/
|
||||||
|
remove_pointer.cc: Likewise.
|
||||||
|
* testsuite/tr1/4_metaprogramming/primary_type_categories/
|
||||||
|
is_pointer/is_pointer.cc: Likewise.
|
||||||
|
* testsuite/tr1/4_metaprogramming/primary_type_categories/
|
||||||
|
is_pointer/typedefs.cc: Likewise.
|
||||||
|
|
||||||
|
* testsuite/tr1/4_metaprogramming/primary_type_categories/
|
||||||
|
is_reference/is_reference.cc: Slightly tweak consistently.
|
||||||
|
|
||||||
2004-12-11 Paolo Carlini <pcarlini@suse.de>
|
2004-12-11 Paolo Carlini <pcarlini@suse.de>
|
||||||
|
|
||||||
* include/tr1/type_traits: Implement rank.
|
* include/tr1/type_traits: Implement rank.
|
||||||
|
|
|
@ -44,48 +44,48 @@ namespace tr1
|
||||||
typedef integral_constant<bool, true> true_type;
|
typedef integral_constant<bool, true> true_type;
|
||||||
typedef integral_constant<bool, false> false_type;
|
typedef integral_constant<bool, false> false_type;
|
||||||
|
|
||||||
#define _DEFINE_PRIMARY_SPEC_HELPER(_Primary, _Type) \
|
#define _DEFINE_SPEC_HELPER(_Header, _Spec) \
|
||||||
template<> \
|
template _Header \
|
||||||
struct _Primary<_Type> \
|
struct _Spec \
|
||||||
: public true_type { };
|
: public true_type { };
|
||||||
|
|
||||||
#define _DEFINE_PRIMARY_SPEC(_Primary, _Type) \
|
#define _DEFINE_SPEC(_Header, _Primary, _Type) \
|
||||||
_DEFINE_PRIMARY_SPEC_HELPER(_Primary, _Type) \
|
_DEFINE_SPEC_HELPER(_Header, _Primary<_Type>) \
|
||||||
_DEFINE_PRIMARY_SPEC_HELPER(_Primary, _Type const) \
|
_DEFINE_SPEC_HELPER(_Header, _Primary<_Type const>) \
|
||||||
_DEFINE_PRIMARY_SPEC_HELPER(_Primary, _Type volatile) \
|
_DEFINE_SPEC_HELPER(_Header, _Primary<_Type volatile>) \
|
||||||
_DEFINE_PRIMARY_SPEC_HELPER(_Primary, _Type const volatile)
|
_DEFINE_SPEC_HELPER(_Header, _Primary<_Type const volatile>)
|
||||||
|
|
||||||
/// @brief primary type categories [4.5.1].
|
/// @brief primary type categories [4.5.1].
|
||||||
template<typename>
|
template<typename>
|
||||||
struct is_void
|
struct is_void
|
||||||
: public false_type { };
|
: public false_type { };
|
||||||
_DEFINE_PRIMARY_SPEC(is_void, void)
|
_DEFINE_SPEC(<>, is_void, void)
|
||||||
|
|
||||||
template<typename>
|
template<typename>
|
||||||
struct is_integral
|
struct is_integral
|
||||||
: public false_type { };
|
: public false_type { };
|
||||||
_DEFINE_PRIMARY_SPEC(is_integral, bool)
|
_DEFINE_SPEC(<>, is_integral, bool)
|
||||||
_DEFINE_PRIMARY_SPEC(is_integral, char)
|
_DEFINE_SPEC(<>, is_integral, char)
|
||||||
_DEFINE_PRIMARY_SPEC(is_integral, signed char)
|
_DEFINE_SPEC(<>, is_integral, signed char)
|
||||||
_DEFINE_PRIMARY_SPEC(is_integral, unsigned char)
|
_DEFINE_SPEC(<>, is_integral, unsigned char)
|
||||||
#ifdef _GLIBCXX_USE_WCHAR_T
|
#ifdef _GLIBCXX_USE_WCHAR_T
|
||||||
_DEFINE_PRIMARY_SPEC(is_integral, wchar_t)
|
_DEFINE_SPEC(<>, is_integral, wchar_t)
|
||||||
#endif
|
#endif
|
||||||
_DEFINE_PRIMARY_SPEC(is_integral, short)
|
_DEFINE_SPEC(<>, is_integral, short)
|
||||||
_DEFINE_PRIMARY_SPEC(is_integral, unsigned short)
|
_DEFINE_SPEC(<>, is_integral, unsigned short)
|
||||||
_DEFINE_PRIMARY_SPEC(is_integral, int)
|
_DEFINE_SPEC(<>, is_integral, int)
|
||||||
_DEFINE_PRIMARY_SPEC(is_integral, unsigned int)
|
_DEFINE_SPEC(<>, is_integral, unsigned int)
|
||||||
_DEFINE_PRIMARY_SPEC(is_integral, long)
|
_DEFINE_SPEC(<>, is_integral, long)
|
||||||
_DEFINE_PRIMARY_SPEC(is_integral, unsigned long)
|
_DEFINE_SPEC(<>, is_integral, unsigned long)
|
||||||
_DEFINE_PRIMARY_SPEC(is_integral, long long)
|
_DEFINE_SPEC(<>, is_integral, long long)
|
||||||
_DEFINE_PRIMARY_SPEC(is_integral, unsigned long long)
|
_DEFINE_SPEC(<>, is_integral, unsigned long long)
|
||||||
|
|
||||||
template<typename>
|
template<typename>
|
||||||
struct is_floating_point
|
struct is_floating_point
|
||||||
: public false_type { };
|
: public false_type { };
|
||||||
_DEFINE_PRIMARY_SPEC(is_floating_point, float)
|
_DEFINE_SPEC(<>, is_floating_point, float)
|
||||||
_DEFINE_PRIMARY_SPEC(is_floating_point, double)
|
_DEFINE_SPEC(<>, is_floating_point, double)
|
||||||
_DEFINE_PRIMARY_SPEC(is_floating_point, long double)
|
_DEFINE_SPEC(<>, is_floating_point, long double)
|
||||||
|
|
||||||
template<typename>
|
template<typename>
|
||||||
struct is_array
|
struct is_array
|
||||||
|
@ -99,8 +99,10 @@ namespace tr1
|
||||||
struct is_array<_Tp[]>
|
struct is_array<_Tp[]>
|
||||||
: public true_type { };
|
: public true_type { };
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename>
|
||||||
struct is_pointer;
|
struct is_pointer
|
||||||
|
: public false_type { };
|
||||||
|
_DEFINE_SPEC(<typename _Tp>, is_pointer, _Tp*)
|
||||||
|
|
||||||
template<typename>
|
template<typename>
|
||||||
struct is_reference
|
struct is_reference
|
||||||
|
@ -128,9 +130,6 @@ namespace tr1
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct is_function;
|
struct is_function;
|
||||||
|
|
||||||
#undef _DEFINE_PRIMARY_SPEC_HELPER
|
|
||||||
#undef _DEFINE_PRIMARY_SPEC
|
|
||||||
|
|
||||||
/// @brief composite type traits [4.5.2].
|
/// @brief composite type traits [4.5.2].
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct is_arithmetic
|
struct is_arithmetic
|
||||||
|
@ -266,27 +265,19 @@ namespace tr1
|
||||||
/// @brief const-volatile modifications [4.7.1].
|
/// @brief const-volatile modifications [4.7.1].
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct remove_const
|
struct remove_const
|
||||||
{
|
{ typedef _Tp type; };
|
||||||
typedef _Tp type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct remove_const<_Tp const>
|
struct remove_const<_Tp const>
|
||||||
{
|
{ typedef _Tp type; };
|
||||||
typedef _Tp type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct remove_volatile
|
struct remove_volatile
|
||||||
{
|
{ typedef _Tp type; };
|
||||||
typedef _Tp type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct remove_volatile<_Tp volatile>
|
struct remove_volatile<_Tp volatile>
|
||||||
{
|
{ typedef _Tp type; };
|
||||||
typedef _Tp type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct remove_cv
|
struct remove_cv
|
||||||
|
@ -307,75 +298,68 @@ namespace tr1
|
||||||
/// @brief reference modifications [4.7.2].
|
/// @brief reference modifications [4.7.2].
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct remove_reference
|
struct remove_reference
|
||||||
{
|
{ typedef _Tp type; };
|
||||||
typedef _Tp type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct remove_reference<_Tp&>
|
struct remove_reference<_Tp&>
|
||||||
{
|
{ typedef _Tp type; };
|
||||||
typedef _Tp type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct add_reference
|
struct add_reference
|
||||||
{
|
{ typedef _Tp& type; };
|
||||||
typedef _Tp& type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct add_reference<_Tp&>
|
struct add_reference<_Tp&>
|
||||||
{
|
{ typedef _Tp& type; };
|
||||||
typedef _Tp& type;
|
|
||||||
};
|
|
||||||
|
|
||||||
/// @brief array modififications [4.7.3].
|
/// @brief array modififications [4.7.3].
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct remove_extent
|
struct remove_extent
|
||||||
{
|
{ typedef _Tp type; };
|
||||||
typedef _Tp type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename _Tp, std::size_t _Size>
|
template<typename _Tp, std::size_t _Size>
|
||||||
struct remove_extent<_Tp[_Size]>
|
struct remove_extent<_Tp[_Size]>
|
||||||
{
|
{ typedef _Tp type; };
|
||||||
typedef _Tp type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct remove_extent<_Tp[]>
|
struct remove_extent<_Tp[]>
|
||||||
{
|
{ typedef _Tp type; };
|
||||||
typedef _Tp type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct remove_all_extents
|
struct remove_all_extents
|
||||||
{
|
{ typedef _Tp type; };
|
||||||
typedef _Tp type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename _Tp, std::size_t _Size>
|
template<typename _Tp, std::size_t _Size>
|
||||||
struct remove_all_extents<_Tp[_Size]>
|
struct remove_all_extents<_Tp[_Size]>
|
||||||
{
|
{ typedef typename remove_all_extents<_Tp>::type type; };
|
||||||
typedef typename remove_all_extents<_Tp>::type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct remove_all_extents<_Tp[]>
|
struct remove_all_extents<_Tp[]>
|
||||||
{
|
{ typedef typename remove_all_extents<_Tp>::type type; };
|
||||||
typedef typename remove_all_extents<_Tp>::type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
/// @brief pointer modifications [4.7.4].
|
/// @brief pointer modifications [4.7.4].
|
||||||
template<typename _Tp>
|
#undef _DEFINE_SPEC_HELPER
|
||||||
struct remove_pointer;
|
#define _DEFINE_SPEC_HELPER(_Header, _Spec) \
|
||||||
|
template _Header \
|
||||||
|
struct _Spec \
|
||||||
|
{ typedef _Tp type; };
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
struct add_pointer;
|
struct remove_pointer
|
||||||
|
{ typedef _Tp type; };
|
||||||
|
_DEFINE_SPEC(<typename _Tp>, remove_pointer, _Tp*)
|
||||||
|
|
||||||
|
template<typename _Tp>
|
||||||
|
struct add_pointer
|
||||||
|
{ typedef typename remove_reference<_Tp>::type* type; };
|
||||||
|
|
||||||
/// @brief other transformations [4.8].
|
/// @brief other transformations [4.8].
|
||||||
template<std::size_t _Len, std::size_t _Align>
|
template<std::size_t _Len, std::size_t _Align>
|
||||||
struct aligned_storage;
|
struct aligned_storage;
|
||||||
|
|
||||||
|
#undef _DEFINE_SPEC_HELPER
|
||||||
|
#undef _DEFINE_SPEC
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
// 2004-12-12 Paolo Carlini <pcarlini@suse.de>
|
||||||
|
//
|
||||||
|
// Copyright (C) 2004 Free Software Foundation, Inc.
|
||||||
|
//
|
||||||
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
// terms of the GNU General Public License as published by the
|
||||||
|
// Free Software Foundation; either version 2, or (at your option)
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License along
|
||||||
|
// with this library; see the file COPYING. If not, write to the Free
|
||||||
|
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
// USA.
|
||||||
|
|
||||||
|
// 4.7.2 Reference modifications
|
||||||
|
|
||||||
|
#include <tr1/type_traits>
|
||||||
|
#include <testsuite_hooks.h>
|
||||||
|
#include <testsuite_tr1.h>
|
||||||
|
|
||||||
|
void test01()
|
||||||
|
{
|
||||||
|
bool test __attribute__((unused)) = true;
|
||||||
|
using std::tr1::add_pointer;
|
||||||
|
using std::tr1::is_same;
|
||||||
|
using namespace __gnu_test;
|
||||||
|
|
||||||
|
VERIFY( (is_same<add_pointer<int>::type, int*>::value) );
|
||||||
|
VERIFY( (is_same<add_pointer<int*>::type, int**>::value) );
|
||||||
|
VERIFY( (is_same<add_pointer<const int>::type, const int*>::value) );
|
||||||
|
VERIFY( (is_same<add_pointer<int&>::type, int*>::value) );
|
||||||
|
VERIFY( (is_same<add_pointer<ClassType*>::type, ClassType**>::value) );
|
||||||
|
VERIFY( (is_same<add_pointer<ClassType>::type, ClassType*>::value) );
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
test01();
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
// 2004-12-12 Paolo Carlini <pcarlini@suse.de>
|
||||||
|
//
|
||||||
|
// Copyright (C) 2004 Free Software Foundation, Inc.
|
||||||
|
//
|
||||||
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
// terms of the GNU General Public License as published by the
|
||||||
|
// Free Software Foundation; either version 2, or (at your option)
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License along
|
||||||
|
// with this library; see the file COPYING. If not, write to the Free
|
||||||
|
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
// USA.
|
||||||
|
|
||||||
|
// 4.7.2 Reference modifications
|
||||||
|
|
||||||
|
#include <tr1/type_traits>
|
||||||
|
#include <testsuite_hooks.h>
|
||||||
|
#include <testsuite_tr1.h>
|
||||||
|
|
||||||
|
void test01()
|
||||||
|
{
|
||||||
|
bool test __attribute__((unused)) = true;
|
||||||
|
using std::tr1::remove_pointer;
|
||||||
|
using std::tr1::is_same;
|
||||||
|
using namespace __gnu_test;
|
||||||
|
|
||||||
|
VERIFY( (is_same<remove_pointer<int*>::type, int>::value) );
|
||||||
|
VERIFY( (is_same<remove_pointer<int>::type, int>::value) );
|
||||||
|
VERIFY( (is_same<remove_pointer<const int*>::type, const int>::value) );
|
||||||
|
VERIFY( (is_same<remove_pointer<int**>::type, int*>::value) );
|
||||||
|
VERIFY( (is_same<remove_pointer<ClassType*>::type, ClassType>::value) );
|
||||||
|
VERIFY( (is_same<remove_pointer<ClassType>::type, ClassType>::value) );
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
test01();
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
// 2004-12-12 Paolo Carlini <pcarlini@suse.de>
|
||||||
|
//
|
||||||
|
// Copyright (C) 2004 Free Software Foundation, Inc.
|
||||||
|
//
|
||||||
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
// terms of the GNU General Public License as published by the
|
||||||
|
// Free Software Foundation; either version 2, or (at your option)
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License along
|
||||||
|
// with this library; see the file COPYING. If not, write to the Free
|
||||||
|
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
// USA.
|
||||||
|
|
||||||
|
// 4.5.1 Primary type categories
|
||||||
|
|
||||||
|
#include <tr1/type_traits>
|
||||||
|
#include <testsuite_hooks.h>
|
||||||
|
#include <testsuite_tr1.h>
|
||||||
|
|
||||||
|
void test01()
|
||||||
|
{
|
||||||
|
bool test __attribute__((unused)) = true;
|
||||||
|
using std::tr1::is_pointer;
|
||||||
|
using namespace __gnu_test;
|
||||||
|
|
||||||
|
VERIFY( (test_category<is_pointer, int*>(true)) );
|
||||||
|
VERIFY( (test_category<is_pointer, ClassType*>(true)) );
|
||||||
|
VERIFY( (test_category<is_pointer, int(*)(int)>(true)) );
|
||||||
|
|
||||||
|
// Sanity check.
|
||||||
|
VERIFY( (test_category<is_pointer, ClassType>(false)) );
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
test01();
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
// 2004-12-12 Paolo Carlini <pcarlini@suse.de>
|
||||||
|
//
|
||||||
|
// Copyright (C) 2004 Free Software Foundation, Inc.
|
||||||
|
//
|
||||||
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
// terms of the GNU General Public License as published by the
|
||||||
|
// Free Software Foundation; either version 2, or (at your option)
|
||||||
|
// any later version.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU General Public License along
|
||||||
|
// with this library; see the file COPYING. If not, write to the Free
|
||||||
|
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||||
|
// USA.
|
||||||
|
|
||||||
|
//
|
||||||
|
// NB: This file is for testing tr1/type_traits with NO OTHER INCLUDES.
|
||||||
|
|
||||||
|
#include <tr1/type_traits>
|
||||||
|
|
||||||
|
// { dg-do compile }
|
||||||
|
|
||||||
|
void test01()
|
||||||
|
{
|
||||||
|
// Check for required typedefs
|
||||||
|
typedef std::tr1::is_pointer<int> test_type;
|
||||||
|
typedef test_type::value_type value_type;
|
||||||
|
typedef test_type::type type;
|
||||||
|
typedef test_type::type::value_type type_value_type;
|
||||||
|
typedef test_type::type::type type_type;
|
||||||
|
}
|
|
@ -30,13 +30,9 @@ void test01()
|
||||||
using std::tr1::is_reference;
|
using std::tr1::is_reference;
|
||||||
using namespace __gnu_test;
|
using namespace __gnu_test;
|
||||||
|
|
||||||
typedef int& int_ref;
|
VERIFY( (test_category<is_reference, int&>(true)) );
|
||||||
typedef ClassType& ClassType_ref;
|
VERIFY( (test_category<is_reference, ClassType&>(true)) );
|
||||||
typedef int (&fun_ref) (int);
|
VERIFY( (test_category<is_reference, int(&)(int)>(true)) );
|
||||||
|
|
||||||
VERIFY( (test_category<is_reference, int_ref>(true)) );
|
|
||||||
VERIFY( (test_category<is_reference, ClassType_ref>(true)) );
|
|
||||||
VERIFY( (test_category<is_reference, fun_ref>(true)) );
|
|
||||||
|
|
||||||
// Sanity check.
|
// Sanity check.
|
||||||
VERIFY( (test_category<is_reference, ClassType>(false)) );
|
VERIFY( (test_category<is_reference, ClassType>(false)) );
|
||||||
|
|
Loading…
Reference in New Issue