From 90b81c3306761f67cf192c219bccbb434bd88541 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Sun, 18 Nov 2007 18:05:42 +0000 Subject: [PATCH] type_traits (is_reference, [...]): Declare. 2007-11-18 Paolo Carlini * 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. From-SVN: r130272 --- libstdc++-v3/ChangeLog | 8 + libstdc++-v3/include/Makefile.am | 1 - libstdc++-v3/include/Makefile.in | 1 - libstdc++-v3/include/tr1_impl/type_traits | 27 ++- .../include/tr1_impl/type_traitsfwd.h | 171 ------------------ 5 files changed, 28 insertions(+), 180 deletions(-) delete mode 100644 libstdc++-v3/include/tr1_impl/type_traitsfwd.h diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 95fbeae6c026..da1204de6181 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2007-11-18 Paolo Carlini + + * 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. + 2007-11-17 Jonathan Wakely * docs/html/17_intro/howto.html, docs/html/21_strings/howto.html, diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index c17d04f35e78..9eee09016f5d 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -594,7 +594,6 @@ tr1_impl_headers = \ ${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 diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index f2e86ade2568..9b2fb033dbe7 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -840,7 +840,6 @@ tr1_impl_headers = \ ${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 diff --git a/libstdc++-v3/include/tr1_impl/type_traits b/libstdc++-v3/include/tr1_impl/type_traits index 3c105d6cf129..2a6227b7c976 100644 --- a/libstdc++-v3/include/tr1_impl/type_traits +++ b/libstdc++-v3/include/tr1_impl/type_traits @@ -32,8 +32,6 @@ * You should not attempt to use it directly. */ -#include - namespace std { _GLIBCXX_BEGIN_NAMESPACE_TR1 @@ -131,7 +129,13 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 struct is_pointer : public false_type { }; _DEFINE_SPEC(1, is_pointer, _Tp*, true) - + + template + struct is_reference; + + template + struct is_function; + template struct is_member_object_pointer : public false_type { }; @@ -171,6 +175,9 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 struct __is_function_helper<_Res(_ArgTypes......)> : public true_type { }; + template + struct remove_cv; + template struct is_function : public integral_constant::value)> { }; + template + struct is_member_pointer; + template struct is_scalar : public integral_constant::value @@ -268,8 +278,8 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 template struct rank<_Tp[]> : public integral_constant::value> { }; - - template + + template struct extent : public integral_constant { }; @@ -286,7 +296,7 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 _Uint == 0 ? 0 : extent<_Tp, _Uint - 1>::value> { }; - + /// @brief relationships between types [4.6]. template struct is_same @@ -369,7 +379,10 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1 struct remove_pointer { typedef _Tp type; }; _DEFINE_SPEC(1, remove_pointer, _Tp*, false) - + + template + struct remove_reference; + template struct add_pointer { typedef typename remove_reference<_Tp>::type* type; }; diff --git a/libstdc++-v3/include/tr1_impl/type_traitsfwd.h b/libstdc++-v3/include/tr1_impl/type_traitsfwd.h deleted file mode 100644 index 558f110dc4a9..000000000000 --- a/libstdc++-v3/include/tr1_impl/type_traitsfwd.h +++ /dev/null @@ -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 - struct integral_constant; - typedef integral_constant true_type; - typedef integral_constant false_type; - - /// @brief primary type categories [4.5.1]. - template - struct is_void; - - template - struct is_integral; - - template - struct is_floating_point; - - template - struct is_array; - - template - struct is_pointer; - - template - struct is_reference; - - template - struct is_member_object_pointer; - - template - struct is_member_function_pointer; - - template - struct is_enum; - - template - struct is_union; - - template - struct is_class; - - template - struct is_function; - - /// @brief composite type traits [4.5.2]. - template - struct is_arithmetic; - - template - struct is_fundamental; - - template - struct is_object; - - template - struct is_scalar; - - template - struct is_compound; - - template - struct is_member_pointer; - - /// @brief type properties [4.5.3]. - template - struct is_const; - - template - struct is_volatile; - - template - struct is_empty; - - template - struct is_polymorphic; - - template - struct is_abstract; - - template - struct has_virtual_destructor; - - template - struct alignment_of; - - template - struct rank; - - template - struct extent; - - /// @brief relationships between types [4.6]. - template - struct is_same; - - /// @brief const-volatile modifications [4.7.1]. - template - struct remove_const; - - template - struct remove_volatile; - - template - struct remove_cv; - - template - struct add_const; - - template - struct add_volatile; - - template - struct add_cv; - - /// @brief reference modifications [4.7.2]. - template - struct remove_reference; - - /// @brief array modifications [4.7.3]. - template - struct remove_extent; - - template - struct remove_all_extents; - - /// @brief pointer modifications [4.7.4]. - template - struct remove_pointer; - - template - struct add_pointer; - -_GLIBCXX_END_NAMESPACE_TR1 -}