From: Paolo Carlini Date: Fri, 19 Feb 2010 18:55:40 +0000 (+0000) Subject: array (array): Add pointer and const_pointer typedefs in C++0x mode, per DR 1306. X-Git-Tag: releases/gcc-4.5.0~699 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cf9280bf7e26b68be590b813d46aea29db5061de;p=thirdparty%2Fgcc.git array (array): Add pointer and const_pointer typedefs in C++0x mode, per DR 1306. 2010-02-19 Paolo Carlini * include/tr1_impl/array (array): Add pointer and const_pointer typedefs in C++0x mode, per DR 1306. * testsuite/util/testsuite_containers.h (basic_types): Add pointer and const_pointer typedefs. (pointer_aware_types): Remove. * testsuite/util/testsuite_container_traits.h: Adjust. From-SVN: r156906 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index e85c5383a7a7..f89d8bc30c0f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2010-02-19 Paolo Carlini + + * include/tr1_impl/array (array): Add pointer and const_pointer + typedefs in C++0x mode, per DR 1306. + * testsuite/util/testsuite_containers.h (basic_types): Add pointer + and const_pointer typedefs. + (pointer_aware_types): Remove. + * testsuite/util/testsuite_container_traits.h: Adjust. + 2010-02-19 Paolo Carlini * include/bits/stl_algo.h (for_each): Implement resolution of DR 1110. diff --git a/libstdc++-v3/include/tr1_impl/array b/libstdc++-v3/include/tr1_impl/array index 7cd3db3d0f90..183f63696c77 100644 --- a/libstdc++-v3/include/tr1_impl/array +++ b/libstdc++-v3/include/tr1_impl/array @@ -1,6 +1,6 @@ // class template array -*- C++ -*- -// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008, 2009, 2010 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 @@ -49,6 +49,10 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 struct array { typedef _Tp value_type; +#ifdef _GLIBCXX_INCLUDE_AS_CXX0X + typedef _Tp* pointer; + typedef const _Tp* const_pointer; +#endif typedef value_type& reference; typedef const value_type& const_reference; typedef value_type* iterator; diff --git a/libstdc++-v3/testsuite/util/testsuite_container_traits.h b/libstdc++-v3/testsuite/util/testsuite_container_traits.h index af375153090d..789384336bf4 100644 --- a/libstdc++-v3/testsuite/util/testsuite_container_traits.h +++ b/libstdc++-v3/testsuite/util/testsuite_container_traits.h @@ -34,7 +34,6 @@ namespace __gnu_test typedef std::false_type is_adaptor; typedef std::false_type is_reversible; typedef std::false_type is_allocator_aware; - typedef std::false_type is_pointer_aware; typedef std::false_type is_associative; typedef std::false_type is_unordered; typedef std::false_type is_mapped; @@ -64,7 +63,6 @@ namespace __gnu_test typedef std::true_type is_container; typedef std::true_type is_reversible; typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; typedef std::true_type has_erase; typedef std::true_type has_insert; @@ -77,7 +75,6 @@ namespace __gnu_test { typedef std::true_type is_container; typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; typedef std::true_type has_erase; typedef std::true_type has_insert; @@ -91,7 +88,6 @@ namespace __gnu_test typedef std::true_type is_container; typedef std::true_type is_reversible; typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; typedef std::true_type has_erase; typedef std::true_type has_insert; @@ -105,7 +101,6 @@ namespace __gnu_test typedef std::true_type is_container; typedef std::true_type is_reversible; typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; typedef std::true_type has_erase; typedef std::true_type has_insert; @@ -118,7 +113,6 @@ namespace __gnu_test typedef std::true_type is_container; typedef std::true_type is_reversible; typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; typedef std::true_type has_erase; typedef std::true_type has_insert; @@ -132,7 +126,6 @@ namespace __gnu_test typedef std::true_type is_container; typedef std::true_type is_reversible; typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; typedef std::true_type has_erase; typedef std::true_type has_insert; @@ -144,7 +137,6 @@ namespace __gnu_test typedef std::true_type is_container; typedef std::true_type is_reversible; typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; typedef std::true_type is_associative; typedef std::true_type is_mapped; @@ -157,7 +149,6 @@ namespace __gnu_test typedef std::true_type is_container; typedef std::true_type is_reversible; typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; typedef std::true_type is_associative; typedef std::true_type is_mapped; @@ -170,7 +161,6 @@ namespace __gnu_test typedef std::true_type is_container; typedef std::true_type is_reversible; typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; typedef std::true_type is_associative; typedef std::true_type has_insert; @@ -182,7 +172,6 @@ namespace __gnu_test typedef std::true_type is_container; typedef std::true_type is_reversible; typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; typedef std::true_type is_associative; typedef std::true_type has_insert; @@ -213,7 +202,6 @@ namespace __gnu_test { typedef std::true_type is_container; typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; typedef std::true_type is_unordered; typedef std::true_type is_mapped; @@ -228,7 +216,6 @@ namespace __gnu_test { typedef std::true_type is_container; typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; typedef std::true_type is_unordered; typedef std::true_type is_mapped; @@ -241,7 +228,6 @@ namespace __gnu_test { typedef std::true_type is_container; typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; typedef std::true_type is_unordered; typedef std::true_type has_size_type_constructor; @@ -254,7 +240,6 @@ namespace __gnu_test { typedef std::true_type is_container; typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; typedef std::true_type is_unordered; typedef std::true_type has_size_type_constructor; diff --git a/libstdc++-v3/testsuite/util/testsuite_containers.h b/libstdc++-v3/testsuite/util/testsuite_containers.h index af07441fbd02..24133cdc5878 100644 --- a/libstdc++-v3/testsuite/util/testsuite_containers.h +++ b/libstdc++-v3/testsuite/util/testsuite_containers.h @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2009 Free Software Foundation, Inc. +// Copyright (C) 2009, 2010 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 @@ -33,6 +33,8 @@ namespace __gnu_test // Base container requirements (table 80) typedef _Tp test_type; typedef typename test_type::value_type value_type; + typedef typename test_type::pointer pointer; + typedef typename test_type::const_pointer const_pointer; typedef typename test_type::reference reference; typedef typename test_type::const_reference const_reference; typedef typename test_type::iterator iterator; @@ -59,15 +61,6 @@ namespace __gnu_test typedef typename test_type::allocator_type allocator_type; }; - template::is_pointer_aware::value> - struct pointer_aware_types - { - // Allocator-aware requirements (table 82) - typedef _Tp test_type; - typedef typename test_type::pointer pointer; - typedef typename test_type::const_pointer const_pointer; - }; - template::is_associative::value> struct associative_types { @@ -114,13 +107,13 @@ namespace __gnu_test struct basic_types<_Tp, false> { }; template - struct reversible_types<_Tp, false> { }; + struct adaptor_types<_Tp, false> { }; template - struct allocator_aware_types<_Tp, false> { }; + struct reversible_types<_Tp, false> { }; template - struct pointer_aware_types<_Tp, false> { }; + struct allocator_aware_types<_Tp, false> { }; template struct associative_types<_Tp, false> { }; @@ -131,15 +124,12 @@ namespace __gnu_test template struct mapped_types<_Tp, false> { }; - template - struct adaptor_types<_Tp, false> { }; - // Primary template. template struct types : basic_types<_Tp>, adaptor_types<_Tp>, reversible_types<_Tp>, - allocator_aware_types<_Tp>, pointer_aware_types<_Tp>, - associative_types<_Tp>, unordered_types<_Tp>, mapped_types<_Tp> + allocator_aware_types<_Tp>, associative_types<_Tp>, + unordered_types<_Tp>, mapped_types<_Tp> { };