This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] Remove type_traitsfwd.h
- From: Paolo Carlini <pcarlini at suse dot de>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 18 Nov 2007 19:07:18 +0100
- Subject: [v3] Remove type_traitsfwd.h
Hi,
tested x86_64-linux, committed to mainline.
Paolo.
//////////////
2007-11-18 Paolo Carlini <pcarlini@suse.de>
* include/tr1_impl/type_traits (is_reference, is_function,
remove_cv, is_member_pointer, remove_reference): Declare.
* include/tr1_impl/type_traitsfwd.h: Remove.
* include/Makefile.am: Adjust.
* include/Makefile.in: Regenerate.
Index: include/tr1_impl/type_traitsfwd.h
===================================================================
--- include/tr1_impl/type_traitsfwd.h (revision 130247)
+++ include/tr1_impl/type_traitsfwd.h (working copy)
@@ -1,171 +0,0 @@
-// TR1 type_traitsfwd.h -*- C++ -*-
-
-// Copyright (C) 2007 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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
-// USA.
-
-// As a special exception, you may use this file as part of a free software
-// library without restriction. Specifically, if other files instantiate
-// templates or use macros or inline functions from this file, or you compile
-// this file and link it with other files to produce an executable, this
-// file does not by itself cause the resulting executable to be covered by
-// the GNU General Public License. This exception does not however
-// invalidate any other reasons why the executable file might be covered by
-// the GNU General Public License.
-
-/** @file tr1_impl/type_traitsfwd.h
- * This is an internal header file, included by other library headers.
- * You should not attempt to use it directly.
- */
-
-namespace std
-{
-_GLIBCXX_BEGIN_NAMESPACE_TR1
-
- /// @brief helper classes [4.3].
- template<typename _Tp, _Tp __v>
- struct integral_constant;
- typedef integral_constant<bool, true> true_type;
- typedef integral_constant<bool, false> false_type;
-
- /// @brief primary type categories [4.5.1].
- template<typename _Tp>
- struct is_void;
-
- template<typename _Tp>
- struct is_integral;
-
- template<typename _Tp>
- struct is_floating_point;
-
- template<typename _Tp>
- struct is_array;
-
- template<typename _Tp>
- struct is_pointer;
-
- template<typename _Tp>
- struct is_reference;
-
- template<typename _Tp>
- struct is_member_object_pointer;
-
- template<typename _Tp>
- struct is_member_function_pointer;
-
- template<typename _Tp>
- struct is_enum;
-
- template<typename _Tp>
- struct is_union;
-
- template<typename _Tp>
- struct is_class;
-
- template<typename _Tp>
- struct is_function;
-
- /// @brief composite type traits [4.5.2].
- template<typename _Tp>
- struct is_arithmetic;
-
- template<typename _Tp>
- struct is_fundamental;
-
- template<typename _Tp>
- struct is_object;
-
- template<typename _Tp>
- struct is_scalar;
-
- template<typename _Tp>
- struct is_compound;
-
- template<typename _Tp>
- struct is_member_pointer;
-
- /// @brief type properties [4.5.3].
- template<typename _Tp>
- struct is_const;
-
- template<typename _Tp>
- struct is_volatile;
-
- template<typename _Tp>
- struct is_empty;
-
- template<typename _Tp>
- struct is_polymorphic;
-
- template<typename _Tp>
- struct is_abstract;
-
- template<typename _Tp>
- struct has_virtual_destructor;
-
- template<typename _Tp>
- struct alignment_of;
-
- template<typename _Tp>
- struct rank;
-
- template<typename _Tp, unsigned _Uint = 0>
- struct extent;
-
- /// @brief relationships between types [4.6].
- template<typename _Tp, typename _Up>
- struct is_same;
-
- /// @brief const-volatile modifications [4.7.1].
- template<typename _Tp>
- struct remove_const;
-
- template<typename _Tp>
- struct remove_volatile;
-
- template<typename _Tp>
- struct remove_cv;
-
- template<typename _Tp>
- struct add_const;
-
- template<typename _Tp>
- struct add_volatile;
-
- template<typename _Tp>
- struct add_cv;
-
- /// @brief reference modifications [4.7.2].
- template<typename _Tp>
- struct remove_reference;
-
- /// @brief array modifications [4.7.3].
- template<typename _Tp>
- struct remove_extent;
-
- template<typename _Tp>
- struct remove_all_extents;
-
- /// @brief pointer modifications [4.7.4].
- template<typename _Tp>
- struct remove_pointer;
-
- template<typename _Tp>
- struct add_pointer;
-
-_GLIBCXX_END_NAMESPACE_TR1
-}
Index: include/tr1_impl/type_traits
===================================================================
--- include/tr1_impl/type_traits (revision 130247)
+++ include/tr1_impl/type_traits (working copy)
@@ -32,8 +32,6 @@
* You should not attempt to use it directly.
*/
-#include <tr1_impl/type_traitsfwd.h>
-
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_TR1
@@ -131,7 +129,13 @@
struct is_pointer
: public false_type { };
_DEFINE_SPEC(1, is_pointer, _Tp*, true)
-
+
+ template<typename _Tp>
+ struct is_reference;
+
+ template<typename _Tp>
+ struct is_function;
+
template<typename>
struct is_member_object_pointer
: public false_type { };
@@ -172,6 +176,9 @@
: public true_type { };
template<typename _Tp>
+ struct remove_cv;
+
+ template<typename _Tp>
struct is_function
: public integral_constant<bool, (__is_function_helper<typename
remove_cv<_Tp>::type>::value)>
@@ -198,6 +205,9 @@
{ };
template<typename _Tp>
+ struct is_member_pointer;
+
+ template<typename _Tp>
struct is_scalar
: public integral_constant<bool, (is_arithmetic<_Tp>::value
|| is_enum<_Tp>::value
@@ -268,8 +278,8 @@
template<typename _Tp>
struct rank<_Tp[]>
: public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
-
- template<typename, unsigned>
+
+ template<typename, unsigned _Uint = 0>
struct extent
: public integral_constant<std::size_t, 0> { };
@@ -286,7 +296,7 @@
_Uint == 0 ? 0 : extent<_Tp,
_Uint - 1>::value>
{ };
-
+
/// @brief relationships between types [4.6].
template<typename, typename>
struct is_same
@@ -369,7 +379,10 @@
struct remove_pointer
{ typedef _Tp type; };
_DEFINE_SPEC(1, remove_pointer, _Tp*, false)
-
+
+ template<typename _Tp>
+ struct remove_reference;
+
template<typename _Tp>
struct add_pointer
{ typedef typename remove_reference<_Tp>::type* type; };
Index: include/Makefile.am
===================================================================
--- include/Makefile.am (revision 130247)
+++ include/Makefile.am (working copy)
@@ -594,7 +594,6 @@
${tr1_impl_srcdir}/regex \
${tr1_impl_srcdir}/tuple \
${tr1_impl_srcdir}/type_traits \
- ${tr1_impl_srcdir}/type_traitsfwd.h \
${tr1_impl_srcdir}/unordered_map \
${tr1_impl_srcdir}/unordered_set \
${tr1_impl_srcdir}/utility