type_traits (has_trivial_copy, [...]): Adjust according to the resolution of TR1...
authorPaolo Carlini <pcarlini@suse.de>
Wed, 27 Apr 2005 15:08:57 +0000 (15:08 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 27 Apr 2005 15:08:57 +0000 (15:08 +0000)
2005-04-27  Paolo Carlini  <pcarlini@suse.de>

* include/tr1/type_traits (has_trivial_copy, has_trivial_assign,
has_nothrow_copy, has_nothrow_assign): Adjust according to the
resolution of TR1 issue 3.21.
* testsuite/testsuite_tr1.h (test_copy_property,
test_assign_property): Remove.
* testsuite/tr1/4_metaprogramming/type_properties/
has_nothrow_assign/has_nothrow_assign.cc: Adjust.
* testsuite/tr1/4_metaprogramming/type_properties/
has_nothrow_copy/has_nothrow_copy.cc: Likewise.
* testsuite/tr1/4_metaprogramming/type_properties/
has_trivial_assign/has_trivial_assign.cc: Likewise.
* testsuite/tr1/4_metaprogramming/type_properties/
has_trivial_copy/has_trivial_copy.cc: Likewise.

From-SVN: r98829

libstdc++-v3/ChangeLog
libstdc++-v3/include/tr1/type_traits
libstdc++-v3/testsuite/testsuite_tr1.h
libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_assign/has_nothrow_assign.cc
libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_copy/has_nothrow_copy.cc
libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_assign/has_trivial_assign.cc
libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_copy/has_trivial_copy.cc

index 8aa4ecc7a8d9404e8a8a68cf0c1efca80f0f6885..ccb473e462cdb69b4e4a10696949aebbb21d4a68 100644 (file)
@@ -1,3 +1,19 @@
+2005-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/tr1/type_traits (has_trivial_copy, has_trivial_assign,
+       has_nothrow_copy, has_nothrow_assign): Adjust according to the
+       resolution of TR1 issue 3.21.
+       * testsuite/testsuite_tr1.h (test_copy_property,
+       test_assign_property): Remove.
+       * testsuite/tr1/4_metaprogramming/type_properties/
+       has_nothrow_assign/has_nothrow_assign.cc: Adjust.
+       * testsuite/tr1/4_metaprogramming/type_properties/
+       has_nothrow_copy/has_nothrow_copy.cc: Likewise.
+       * testsuite/tr1/4_metaprogramming/type_properties/
+       has_trivial_assign/has_trivial_assign.cc: Likewise.
+       * testsuite/tr1/4_metaprogramming/type_properties/
+       has_trivial_copy/has_trivial_copy.cc: Likewise.
+
 2005-04-26  Jones Desougi  <jones@ingate.com>
 
        PR libstdc++/21131
index 55f585f9f4be02ad98c67b78309a03606a37963a..0bd05bb1198a7067144fffa2efda4c22f22f4749 100644 (file)
@@ -366,14 +366,11 @@ namespace tr1
 
   template<typename _Tp>
     struct has_trivial_copy
-    : public integral_constant<bool, (is_pod<_Tp>::value 
-                                     && !is_volatile<_Tp>::value)> { };
+    : public integral_constant<bool, is_pod<_Tp>::value> { };
 
   template<typename _Tp>
     struct has_trivial_assign
-    : public integral_constant<bool, (is_pod<_Tp>::value
-                                     && !is_const<_Tp>::value
-                                     && !is_volatile<_Tp>::value)> { };
+    : public integral_constant<bool, is_pod<_Tp>::value> { };
 
   template<typename _Tp>
     struct has_trivial_destructor
@@ -385,14 +382,11 @@ namespace tr1
 
   template<typename _Tp>
     struct has_nothrow_copy
-    : public integral_constant<bool, (is_pod<_Tp>::value 
-                                     && !is_volatile<_Tp>::value)> { };
+    : public integral_constant<bool, is_pod<_Tp>::value> { };
 
   template<typename _Tp>
     struct has_nothrow_assign
-    : public integral_constant<bool, (is_pod<_Tp>::value
-                                     && !is_const<_Tp>::value
-                                     && !is_volatile<_Tp>::value)> { };
+    : public integral_constant<bool, is_pod<_Tp>::value> { };
 
   template<typename>
     struct has_virtual_destructor
index ea6affb37c1dba96596376621fa229befd4403bf..ff0a3cefce324f838d60867a05d957fe60346ba9 100644 (file)
@@ -62,40 +62,6 @@ namespace __gnu_test
       return ret;
     }
 
-  template<template<typename> class Property,
-           typename Type>
-    bool
-    test_copy_property(bool value)
-    {
-      bool ret = true;
-      ret &= Property<Type>::value == value;
-      ret &= Property<const Type>::value == value;
-      ret &= Property<volatile Type>::value == !value;
-      ret &= Property<const volatile Type>::value == !value;
-      ret &= Property<Type>::type::value == value;
-      ret &= Property<const Type>::type::value == value;
-      ret &= Property<volatile Type>::type::value == !value;
-      ret &= Property<const volatile Type>::type::value == !value;
-      return ret;
-    }
-
-  template<template<typename> class Property,
-           typename Type>
-    bool
-    test_assign_property(bool value)
-    {
-      bool ret = true;
-      ret &= Property<Type>::value == value;
-      ret &= Property<const Type>::value == !value;
-      ret &= Property<volatile Type>::value == !value;
-      ret &= Property<const volatile Type>::value == !value;
-      ret &= Property<Type>::type::value == value;
-      ret &= Property<const Type>::type::value == !value;
-      ret &= Property<volatile Type>::type::value == !value;
-      ret &= Property<const volatile Type>::type::value == !value;
-      return ret;
-    }
-
   template<template<typename, typename> class Relationship,
            typename Type1, typename Type2>
     bool
index e07fa4f589fb1112d0643a507401ba131dbbe121..f8f25e8c84e33a09eff9e719c02063e26ba4316e 100644 (file)
@@ -1,6 +1,6 @@
 // 2004-12-30  Paolo Carlini  <pcarlini@suse.de>
 //
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 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
@@ -30,23 +30,21 @@ void test01()
   using std::tr1::has_nothrow_assign;
   using namespace __gnu_test;
 
-  VERIFY( (test_assign_property<has_nothrow_assign, void>(true)) );
-  VERIFY( (test_assign_property<has_nothrow_assign, int>(true)) );
-  VERIFY( (test_assign_property<has_nothrow_assign, float>(true)) );
-  VERIFY( (test_assign_property<has_nothrow_assign, EnumType>(true)) );
-  VERIFY( (test_assign_property<has_nothrow_assign, int*>(true)) );
-  VERIFY( (test_assign_property<has_nothrow_assign, int(*)(int)>(true)) );
-  VERIFY( (test_assign_property<has_nothrow_assign, int (ClassType::*)>(true)) );
-  VERIFY( (test_assign_property<has_nothrow_assign,
-          int (ClassType::*) (int)>(true)) );
-  VERIFY( (test_assign_property<has_nothrow_assign, int[2]>(true)) );
-  VERIFY( (test_assign_property<has_nothrow_assign, float[][3]>(true)) );
-  VERIFY( (test_assign_property<has_nothrow_assign, EnumType[2][3][4]>(true)) );
-  VERIFY( (test_assign_property<has_nothrow_assign, int*[3]>(true)) );
-  VERIFY( (test_assign_property<has_nothrow_assign, int(*[][2])(int)>(true)) );
-  VERIFY( (test_assign_property<has_nothrow_assign,
-          int (ClassType::*[2][3])>(true)) );
-  VERIFY( (test_assign_property<has_nothrow_assign,
+  VERIFY( (test_category<has_nothrow_assign, void>(true)) );
+  VERIFY( (test_category<has_nothrow_assign, int>(true)) );
+  VERIFY( (test_category<has_nothrow_assign, float>(true)) );
+  VERIFY( (test_category<has_nothrow_assign, EnumType>(true)) );
+  VERIFY( (test_category<has_nothrow_assign, int*>(true)) );
+  VERIFY( (test_category<has_nothrow_assign, int(*)(int)>(true)) );
+  VERIFY( (test_category<has_nothrow_assign, int (ClassType::*)>(true)) );
+  VERIFY( (test_category<has_nothrow_assign, int (ClassType::*) (int)>(true)) );
+  VERIFY( (test_category<has_nothrow_assign, int[2]>(true)) );
+  VERIFY( (test_category<has_nothrow_assign, float[][3]>(true)) );
+  VERIFY( (test_category<has_nothrow_assign, EnumType[2][3][4]>(true)) );
+  VERIFY( (test_category<has_nothrow_assign, int*[3]>(true)) );
+  VERIFY( (test_category<has_nothrow_assign, int(*[][2])(int)>(true)) );
+  VERIFY( (test_category<has_nothrow_assign, int (ClassType::*[2][3])>(true)) );
+  VERIFY( (test_category<has_nothrow_assign, 
           int (ClassType::*[][2][3]) (int)>(true)) );
 }
 
index 7ba63bfa95491f9f2eb248d9a0e7db965f88e4cf..7d59d5aafff88c72afbce1c3e651af4e00c414ec 100644 (file)
@@ -1,6 +1,6 @@
 // 2004-12-30  Paolo Carlini  <pcarlini@suse.de>
 //
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 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
@@ -30,23 +30,21 @@ void test01()
   using std::tr1::has_nothrow_copy;
   using namespace __gnu_test;
 
-  VERIFY( (test_copy_property<has_nothrow_copy, void>(true)) );
-  VERIFY( (test_copy_property<has_nothrow_copy, int>(true)) );
-  VERIFY( (test_copy_property<has_nothrow_copy, float>(true)) );
-  VERIFY( (test_copy_property<has_nothrow_copy, EnumType>(true)) );
-  VERIFY( (test_copy_property<has_nothrow_copy, int*>(true)) );
-  VERIFY( (test_copy_property<has_nothrow_copy, int(*)(int)>(true)) );
-  VERIFY( (test_copy_property<has_nothrow_copy, int (ClassType::*)>(true)) );
-  VERIFY( (test_copy_property<has_nothrow_copy,
-          int (ClassType::*) (int)>(true)) );
-  VERIFY( (test_copy_property<has_nothrow_copy, int[2]>(true)) );
-  VERIFY( (test_copy_property<has_nothrow_copy, float[][3]>(true)) );
-  VERIFY( (test_copy_property<has_nothrow_copy, EnumType[2][3][4]>(true)) );
-  VERIFY( (test_copy_property<has_nothrow_copy, int*[3]>(true)) );
-  VERIFY( (test_copy_property<has_nothrow_copy, int(*[][2])(int)>(true)) );
-  VERIFY( (test_copy_property<has_nothrow_copy,
-          int (ClassType::*[2][3])>(true)) );
-  VERIFY( (test_copy_property<has_nothrow_copy,
+  VERIFY( (test_category<has_nothrow_copy, void>(true)) );
+  VERIFY( (test_category<has_nothrow_copy, int>(true)) );
+  VERIFY( (test_category<has_nothrow_copy, float>(true)) );
+  VERIFY( (test_category<has_nothrow_copy, EnumType>(true)) );
+  VERIFY( (test_category<has_nothrow_copy, int*>(true)) );
+  VERIFY( (test_category<has_nothrow_copy, int(*)(int)>(true)) );
+  VERIFY( (test_category<has_nothrow_copy, int (ClassType::*)>(true)) );
+  VERIFY( (test_category<has_nothrow_copy, int (ClassType::*) (int)>(true)) );
+  VERIFY( (test_category<has_nothrow_copy, int[2]>(true)) );
+  VERIFY( (test_category<has_nothrow_copy, float[][3]>(true)) );
+  VERIFY( (test_category<has_nothrow_copy, EnumType[2][3][4]>(true)) );
+  VERIFY( (test_category<has_nothrow_copy, int*[3]>(true)) );
+  VERIFY( (test_category<has_nothrow_copy, int(*[][2])(int)>(true)) );
+  VERIFY( (test_category<has_nothrow_copy, int (ClassType::*[2][3])>(true)) );
+  VERIFY( (test_category<has_nothrow_copy,
           int (ClassType::*[][2][3]) (int)>(true)) );
 }
 
index 66b2bc18c386e2d3ece3382d75d08404ac4f3557..466697429a7b66c132d39ad43a898075cd9fe6b1 100644 (file)
@@ -1,6 +1,6 @@
 // 2004-12-30  Paolo Carlini  <pcarlini@suse.de>
 //
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 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
@@ -30,23 +30,21 @@ void test01()
   using std::tr1::has_trivial_assign;
   using namespace __gnu_test;
 
-  VERIFY( (test_assign_property<has_trivial_assign, void>(true)) );
-  VERIFY( (test_assign_property<has_trivial_assign, int>(true)) );
-  VERIFY( (test_assign_property<has_trivial_assign, float>(true)) );
-  VERIFY( (test_assign_property<has_trivial_assign, EnumType>(true)) );
-  VERIFY( (test_assign_property<has_trivial_assign, int*>(true)) );
-  VERIFY( (test_assign_property<has_trivial_assign, int(*)(int)>(true)) );
-  VERIFY( (test_assign_property<has_trivial_assign, int (ClassType::*)>(true)) );
-  VERIFY( (test_assign_property<has_trivial_assign,
-          int (ClassType::*) (int)>(true)) );
-  VERIFY( (test_assign_property<has_trivial_assign, int[2]>(true)) );
-  VERIFY( (test_assign_property<has_trivial_assign, float[][3]>(true)) );
-  VERIFY( (test_assign_property<has_trivial_assign, EnumType[2][3][4]>(true)) );
-  VERIFY( (test_assign_property<has_trivial_assign, int*[3]>(true)) );
-  VERIFY( (test_assign_property<has_trivial_assign, int(*[][2])(int)>(true)) );
-  VERIFY( (test_assign_property<has_trivial_assign,
-          int (ClassType::*[2][3])>(true)) );
-  VERIFY( (test_assign_property<has_trivial_assign,
+  VERIFY( (test_category<has_trivial_assign, void>(true)) );
+  VERIFY( (test_category<has_trivial_assign, int>(true)) );
+  VERIFY( (test_category<has_trivial_assign, float>(true)) );
+  VERIFY( (test_category<has_trivial_assign, EnumType>(true)) );
+  VERIFY( (test_category<has_trivial_assign, int*>(true)) );
+  VERIFY( (test_category<has_trivial_assign, int(*)(int)>(true)) );
+  VERIFY( (test_category<has_trivial_assign, int (ClassType::*)>(true)) );
+  VERIFY( (test_category<has_trivial_assign, int (ClassType::*) (int)>(true)) );
+  VERIFY( (test_category<has_trivial_assign, int[2]>(true)) );
+  VERIFY( (test_category<has_trivial_assign, float[][3]>(true)) );
+  VERIFY( (test_category<has_trivial_assign, EnumType[2][3][4]>(true)) );
+  VERIFY( (test_category<has_trivial_assign, int*[3]>(true)) );
+  VERIFY( (test_category<has_trivial_assign, int(*[][2])(int)>(true)) );
+  VERIFY( (test_category<has_trivial_assign, int (ClassType::*[2][3])>(true)) );
+  VERIFY( (test_category<has_trivial_assign,
           int (ClassType::*[][2][3]) (int)>(true)) );
 }
 
index 64eed997d60499bb60f271aa83f93bac4840e33a..fabe255bbf86d29f4d667df576a1dbd34bc3ee00 100644 (file)
@@ -1,6 +1,6 @@
 // 2004-12-30  Paolo Carlini  <pcarlini@suse.de>
 //
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 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
@@ -30,23 +30,21 @@ void test01()
   using std::tr1::has_trivial_copy;
   using namespace __gnu_test;
 
-  VERIFY( (test_copy_property<has_trivial_copy, void>(true)) );
-  VERIFY( (test_copy_property<has_trivial_copy, int>(true)) );
-  VERIFY( (test_copy_property<has_trivial_copy, float>(true)) );
-  VERIFY( (test_copy_property<has_trivial_copy, EnumType>(true)) );
-  VERIFY( (test_copy_property<has_trivial_copy, int*>(true)) );
-  VERIFY( (test_copy_property<has_trivial_copy, int(*)(int)>(true)) );
-  VERIFY( (test_copy_property<has_trivial_copy, int (ClassType::*)>(true)) );
-  VERIFY( (test_copy_property<has_trivial_copy,
-          int (ClassType::*) (int)>(true)) );
-  VERIFY( (test_copy_property<has_trivial_copy, int[2]>(true)) );
-  VERIFY( (test_copy_property<has_trivial_copy, float[][3]>(true)) );
-  VERIFY( (test_copy_property<has_trivial_copy, EnumType[2][3][4]>(true)) );
-  VERIFY( (test_copy_property<has_trivial_copy, int*[3]>(true)) );
-  VERIFY( (test_copy_property<has_trivial_copy, int(*[][2])(int)>(true)) );
-  VERIFY( (test_copy_property<has_trivial_copy,
-          int (ClassType::*[2][3])>(true)) );
-  VERIFY( (test_copy_property<has_trivial_copy,
+  VERIFY( (test_category<has_trivial_copy, void>(true)) );
+  VERIFY( (test_category<has_trivial_copy, int>(true)) );
+  VERIFY( (test_category<has_trivial_copy, float>(true)) );
+  VERIFY( (test_category<has_trivial_copy, EnumType>(true)) );
+  VERIFY( (test_category<has_trivial_copy, int*>(true)) );
+  VERIFY( (test_category<has_trivial_copy, int(*)(int)>(true)) );
+  VERIFY( (test_category<has_trivial_copy, int (ClassType::*)>(true)) );
+  VERIFY( (test_category<has_trivial_copy, int (ClassType::*) (int)>(true)) );
+  VERIFY( (test_category<has_trivial_copy, int[2]>(true)) );
+  VERIFY( (test_category<has_trivial_copy, float[][3]>(true)) );
+  VERIFY( (test_category<has_trivial_copy, EnumType[2][3][4]>(true)) );
+  VERIFY( (test_category<has_trivial_copy, int*[3]>(true)) );
+  VERIFY( (test_category<has_trivial_copy, int(*[][2])(int)>(true)) );
+  VERIFY( (test_category<has_trivial_copy, int (ClassType::*[2][3])>(true)) );
+  VERIFY( (test_category<has_trivial_copy,
           int (ClassType::*[][2][3]) (int)>(true)) );
 }