Commit c0736a9d by Paolo Carlini Committed by Paolo Carlini

cpp_type_traits.h: Add types to the structs thus making type_traits.h redundant...

2005-01-31  Paolo Carlini  <pcarlini@suse.de>
	    Gabriel Dos Reis  <gdr@integrable-solutions.net>

	* include/bits/cpp_type_traits.h: Add types to the structs thus
	making type_traits.h redundant; exploit new __truth_type and
	__traitor helpers.
	* include/bits/type_traits.h: Remove.
	* include/Makefile.am: Update.
	* include/Makefile.in: Regenerate.
	* include/backward/tempbuf.h: Include cpp_type_traits.h instead.
	* include/bits/basic_string.h (replace(iterator, iterator,
	_InputIterator, _InputIterator), _S_construct(_InIterator,
	_InIterator, const _Alloc&)): Use __is_integer instead.
	* include/bits/stl_bvector.h (vector(_InputIterator,
	_InputIterator, const allocator_type&), assign(_InputIterator,
	_InputIterator), insert(iterator, _InputIterator, _InputIterator)):
	Likewise.
	* include/bits/stl_construct.h (_Destroy(_ForwardIterator,
	_ForwardIterator)): Use __is_scalar.
	* include/bits/stl_deque.h (deque(_InputIterator, _InputIterator,
	const allocator_type&), assign(_InputIterator, _InputIterator),
	insert(iterator, _InputIterator, _InputIterator)): Use __is_integer.
	* include/bits/stl_list.h (assign(_InputIterator, _InputIterator),
	insert(iterator, _InputIterator, _InputIterator)): Likewise.
	* include/bits/stl_tempbuf.h (_Temporary_buffer(_ForwardIterator,
	_ForwardIterator)): Use __is_scalar.
	* include/bits/stl_uninitialized.h (uninitialized_copy(_InputIterator,
	_InputIterator, _ForwardIterator), uninitialized_fill(_ForwardIterator,
	_ForwardIterator, const _Tp&), uninitialized_fill_n(_ForwardIterator,
	_Size, const _Tp&)): Likewise.
	* include/bits/stl_vector.h (vector(_InputIterator, _InputIterator,
	const allocator_type&), assign(_InputIterator, _InputIterator),
	insert(iterator, _InputIterator, _InputIterator)): Use __is_integer.
	* include/debug/debug.h (__valid_range(const _InputIterator&,
	const _InputIterator&)): Use __is_integer.
	* include/ext/slist (assign(_InputIterator, _InputIterator)): Likewise.
	* include/std/std_string.h: Include cpp_type_traits.h instead.

Co-Authored-By: Gabriel Dos Reis <gdr@integrable-solutions.net>

From-SVN: r94484
parent 4e8f0a2e
2005-01-31 Paolo Carlini <pcarlini@suse.de>
Gabriel Dos Reis <gdr@integrable-solutions.net>
* include/bits/cpp_type_traits.h: Add types to the structs thus
making type_traits.h redundant; exploit new __truth_type and
__traitor helpers.
* include/bits/type_traits.h: Remove.
* include/Makefile.am: Update.
* include/Makefile.in: Regenerate.
* include/backward/tempbuf.h: Include cpp_type_traits.h instead.
* include/bits/basic_string.h (replace(iterator, iterator,
_InputIterator, _InputIterator), _S_construct(_InIterator,
_InIterator, const _Alloc&)): Use __is_integer instead.
* include/bits/stl_bvector.h (vector(_InputIterator,
_InputIterator, const allocator_type&), assign(_InputIterator,
_InputIterator), insert(iterator, _InputIterator, _InputIterator)):
Likewise.
* include/bits/stl_construct.h (_Destroy(_ForwardIterator,
_ForwardIterator)): Use __is_scalar.
* include/bits/stl_deque.h (deque(_InputIterator, _InputIterator,
const allocator_type&), assign(_InputIterator, _InputIterator),
insert(iterator, _InputIterator, _InputIterator)): Use __is_integer.
* include/bits/stl_list.h (assign(_InputIterator, _InputIterator),
insert(iterator, _InputIterator, _InputIterator)): Likewise.
* include/bits/stl_tempbuf.h (_Temporary_buffer(_ForwardIterator,
_ForwardIterator)): Use __is_scalar.
* include/bits/stl_uninitialized.h (uninitialized_copy(_InputIterator,
_InputIterator, _ForwardIterator), uninitialized_fill(_ForwardIterator,
_ForwardIterator, const _Tp&), uninitialized_fill_n(_ForwardIterator,
_Size, const _Tp&)): Likewise.
* include/bits/stl_vector.h (vector(_InputIterator, _InputIterator,
const allocator_type&), assign(_InputIterator, _InputIterator),
insert(iterator, _InputIterator, _InputIterator)): Use __is_integer.
* include/debug/debug.h (__valid_range(const _InputIterator&,
const _InputIterator&)): Use __is_integer.
* include/ext/slist (assign(_InputIterator, _InputIterator)): Likewise.
* include/std/std_string.h: Include cpp_type_traits.h instead.
2005-01-30 Paolo Carlini <pcarlini@suse.de> 2005-01-30 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/19642 PR libstdc++/19642
......
## Makefile for the include subdirectory of the GNU C++ Standard library. ## Makefile for the include subdirectory of the GNU C++ Standard library.
## ##
## Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ## Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
## ##
## This file is part of the libstdc++ version 3 distribution. ## This file is part of the libstdc++ version 3 distribution.
## Process this file with automake to produce Makefile.in. ## Process this file with automake to produce Makefile.in.
...@@ -150,7 +150,6 @@ bits_headers = \ ...@@ -150,7 +150,6 @@ bits_headers = \
${bits_srcdir}/stl_vector.h \ ${bits_srcdir}/stl_vector.h \
${bits_srcdir}/streambuf.tcc \ ${bits_srcdir}/streambuf.tcc \
${bits_srcdir}/stringfwd.h \ ${bits_srcdir}/stringfwd.h \
${bits_srcdir}/type_traits.h \
${bits_srcdir}/valarray_array.h \ ${bits_srcdir}/valarray_array.h \
${bits_srcdir}/valarray_array.tcc \ ${bits_srcdir}/valarray_array.tcc \
${bits_srcdir}/valarray_before.h \ ${bits_srcdir}/valarray_before.h \
......
# Makefile.in generated by automake 1.9.4 from Makefile.am. # Makefile.in generated by automake 1.9.3 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
...@@ -366,7 +366,6 @@ bits_headers = \ ...@@ -366,7 +366,6 @@ bits_headers = \
${bits_srcdir}/stl_vector.h \ ${bits_srcdir}/stl_vector.h \
${bits_srcdir}/streambuf.tcc \ ${bits_srcdir}/streambuf.tcc \
${bits_srcdir}/stringfwd.h \ ${bits_srcdir}/stringfwd.h \
${bits_srcdir}/type_traits.h \
${bits_srcdir}/valarray_array.h \ ${bits_srcdir}/valarray_array.h \
${bits_srcdir}/valarray_array.tcc \ ${bits_srcdir}/valarray_array.tcc \
${bits_srcdir}/valarray_before.h \ ${bits_srcdir}/valarray_before.h \
......
// Backward-compat support -*- C++ -*- // Backward-compat support -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc. // Copyright (C) 2001, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
#include <limits.h> #include <limits.h>
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#include <bits/type_traits.h> #include <bits/cpp_type_traits.h>
#include <bits/stl_construct.h> #include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h> #include <bits/stl_uninitialized.h>
#include <ext/memory> #include <ext/memory>
......
// Components for manipulating sequences of characters -*- C++ -*- // Components for manipulating sequences of characters -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -1361,7 +1361,7 @@ namespace std ...@@ -1361,7 +1361,7 @@ namespace std
_GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2 _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
&& __i2 <= _M_iend()); && __i2 <= _M_iend());
__glibcxx_requires_valid_range(__k1, __k2); __glibcxx_requires_valid_range(__k1, __k2);
typedef typename _Is_integer<_InputIterator>::_Integral _Integral; typedef typename std::__is_integer<_InputIterator>::__type _Integral;
return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral()); return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
} }
...@@ -1451,7 +1451,7 @@ namespace std ...@@ -1451,7 +1451,7 @@ namespace std
static _CharT* static _CharT*
_S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a) _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a)
{ {
typedef typename _Is_integer<_InIterator>::_Integral _Integral; typedef typename std::__is_integer<_InIterator>::__type _Integral;
return _S_construct_aux(__beg, __end, __a, _Integral()); return _S_construct_aux(__beg, __end, __a, _Integral());
} }
......
// The -*- C++ -*- type traits classes for internal use in libstdc++ // The -*- C++ -*- type traits classes for internal use in libstdc++
// Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. // Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
// Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -39,6 +40,8 @@ ...@@ -39,6 +40,8 @@
#pragma GCC system_header #pragma GCC system_header
#include <bits/c++config.h>
// //
// This file provides some compile-time information about various types. // This file provides some compile-time information about various types.
// These representations were designed, on purpose, to be constant-expressions // These representations were designed, on purpose, to be constant-expressions
...@@ -63,6 +66,9 @@ ...@@ -63,6 +66,9 @@
// //
// -- Gaby (dosreis@cmla.ens-cachan.fr) 2000-03-06. // -- Gaby (dosreis@cmla.ens-cachan.fr) 2000-03-06.
// //
// Update 2005: types are also provided and <bits/type_traits.h> has been
// removed.
//
// NB: g++ can not compile these if declared within the class // NB: g++ can not compile these if declared within the class
// __is_pod itself. // __is_pod itself.
...@@ -84,8 +90,26 @@ namespace __gnu_cxx ...@@ -84,8 +90,26 @@ namespace __gnu_cxx
class __normal_iterator; class __normal_iterator;
} // namespace __gnu_cxx } // namespace __gnu_cxx
struct __true_type { };
struct __false_type { };
namespace std namespace std
{ {
template<bool>
struct __truth_type
{ typedef __false_type __type; };
template<>
struct __truth_type<true>
{ typedef __true_type __type; };
template<class _Sp, class _Tp>
struct __traitor
{
enum { _M_type = _Sp::_M_type || _Tp::_M_type };
typedef typename __truth_type<_M_type>::__type __type;
};
// Compare for equality of types. // Compare for equality of types.
template<typename, typename> template<typename, typename>
struct __are_same struct __are_same
...@@ -108,7 +132,7 @@ namespace std ...@@ -108,7 +132,7 @@ namespace std
// Define a nested type if some predicate holds. // Define a nested type if some predicate holds.
template<typename, bool> template<typename, bool>
struct __enable_if struct __enable_if
{ {
}; };
template<typename _Tp> template<typename _Tp>
...@@ -121,19 +145,15 @@ namespace std ...@@ -121,19 +145,15 @@ namespace std
template<typename _Tp> template<typename _Tp>
struct __is_void struct __is_void
{ {
enum enum { _M_type = 0 };
{ typedef __false_type __type;
_M_type = 0
};
}; };
template<> template<>
struct __is_void<void> struct __is_void<void>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
// //
...@@ -142,10 +162,8 @@ namespace std ...@@ -142,10 +162,8 @@ namespace std
template<typename _Tp> template<typename _Tp>
struct __is_integer struct __is_integer
{ {
enum enum { _M_type = 0 };
{ typedef __false_type __type;
_M_type = 0
};
}; };
// Thirteen specializations (yes there are eleven standard integer // Thirteen specializations (yes there are eleven standard integer
...@@ -154,120 +172,94 @@ namespace std ...@@ -154,120 +172,94 @@ namespace std
template<> template<>
struct __is_integer<bool> struct __is_integer<bool>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
template<> template<>
struct __is_integer<char> struct __is_integer<char>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
template<> template<>
struct __is_integer<signed char> struct __is_integer<signed char>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
template<> template<>
struct __is_integer<unsigned char> struct __is_integer<unsigned char>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
# ifdef _GLIBCXX_USE_WCHAR_T # ifdef _GLIBCXX_USE_WCHAR_T
template<> template<>
struct __is_integer<wchar_t> struct __is_integer<wchar_t>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
# endif # endif
template<> template<>
struct __is_integer<short> struct __is_integer<short>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
template<> template<>
struct __is_integer<unsigned short> struct __is_integer<unsigned short>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
template<> template<>
struct __is_integer<int> struct __is_integer<int>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
template<> template<>
struct __is_integer<unsigned int> struct __is_integer<unsigned int>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
template<> template<>
struct __is_integer<long> struct __is_integer<long>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
template<> template<>
struct __is_integer<unsigned long> struct __is_integer<unsigned long>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
template<> template<>
struct __is_integer<long long> struct __is_integer<long long>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
template<> template<>
struct __is_integer<unsigned long long> struct __is_integer<unsigned long long>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
// //
...@@ -276,38 +268,30 @@ namespace std ...@@ -276,38 +268,30 @@ namespace std
template<typename _Tp> template<typename _Tp>
struct __is_floating struct __is_floating
{ {
enum enum { _M_type = 0 };
{ typedef __false_type __type;
_M_type = 0
};
}; };
// three specializations (float, double and 'long double') // three specializations (float, double and 'long double')
template<> template<>
struct __is_floating<float> struct __is_floating<float>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
template<> template<>
struct __is_floating<double> struct __is_floating<double>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
template<> template<>
struct __is_floating<long double> struct __is_floating<long double>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
// //
...@@ -316,19 +300,15 @@ namespace std ...@@ -316,19 +300,15 @@ namespace std
template<typename _Tp> template<typename _Tp>
struct __is_pointer struct __is_pointer
{ {
enum enum { _M_type = 0 };
{ typedef __false_type __type;
_M_type = 0
};
}; };
template<typename _Tp> template<typename _Tp>
struct __is_pointer<_Tp*> struct __is_pointer<_Tp*>
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
// //
...@@ -337,20 +317,16 @@ namespace std ...@@ -337,20 +317,16 @@ namespace std
template<typename _Tp> template<typename _Tp>
struct __is_normal_iterator struct __is_normal_iterator
{ {
enum enum { _M_type = 0 };
{ typedef __false_type __type;
_M_type = 0
};
}; };
template<typename _Iterator, typename _Container> template<typename _Iterator, typename _Container>
struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator, struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
_Container> > _Container> >
{ {
enum enum { _M_type = 1 };
{ typedef __true_type __type;
_M_type = 1
};
}; };
// //
...@@ -358,36 +334,24 @@ namespace std ...@@ -358,36 +334,24 @@ namespace std
// //
template<typename _Tp> template<typename _Tp>
struct __is_arithmetic struct __is_arithmetic
{ : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
enum { };
{
_M_type = __is_integer<_Tp>::_M_type || __is_floating<_Tp>::_M_type
};
};
// //
// A fundamental type is `void' or and arithmetic type // A fundamental type is `void' or and arithmetic type
// //
template<typename _Tp> template<typename _Tp>
struct __is_fundamental struct __is_fundamental
{ : public __traitor<__is_void<_Tp>, __is_arithmetic<_Tp> >
enum { };
{
_M_type = __is_void<_Tp>::_M_type || __is_arithmetic<_Tp>::_M_type
};
};
// //
// A scalar type is an arithmetic type or a pointer type // A scalar type is an arithmetic type or a pointer type
// //
template<typename _Tp> template<typename _Tp>
struct __is_scalar struct __is_scalar
{ : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
enum { };
{
_M_type = __is_arithmetic<_Tp>::_M_type || __is_pointer<_Tp>::_M_type
};
};
// //
// For the immediate use, the following is a good approximation // For the immediate use, the following is a good approximation
......
// vector<bool> specialization -*- C++ -*- // vector<bool> specialization -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -673,7 +673,7 @@ template<typename _Alloc> ...@@ -673,7 +673,7 @@ template<typename _Alloc>
const allocator_type& __a = allocator_type()) const allocator_type& __a = allocator_type())
: _Bvector_base<_Alloc>(__a) : _Bvector_base<_Alloc>(__a)
{ {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral; typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_initialize_dispatch(__first, __last, _Integral()); _M_initialize_dispatch(__first, __last, _Integral());
} }
...@@ -724,7 +724,7 @@ template<typename _Alloc> ...@@ -724,7 +724,7 @@ template<typename _Alloc>
void void
assign(_InputIterator __first, _InputIterator __last) assign(_InputIterator __first, _InputIterator __last)
{ {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral; typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_assign_dispatch(__first, __last, _Integral()); _M_assign_dispatch(__first, __last, _Integral());
} }
...@@ -863,7 +863,7 @@ template<typename _Alloc> ...@@ -863,7 +863,7 @@ template<typename _Alloc>
insert(iterator __position, insert(iterator __position,
_InputIterator __first, _InputIterator __last) _InputIterator __first, _InputIterator __last)
{ {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral; typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_insert_dispatch(__position, __first, __last, _Integral()); _M_insert_dispatch(__position, __first, __last, _Integral());
} }
......
// nonstandard construct and destroy functions -*- C++ -*- // nonstandard construct and destroy functions -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
#ifndef _STL_CONSTRUCT_H #ifndef _STL_CONSTRUCT_H
#define _STL_CONSTRUCT_H 1 #define _STL_CONSTRUCT_H 1
#include <bits/type_traits.h> #include <bits/cpp_type_traits.h>
#include <new> #include <new>
namespace std namespace std
...@@ -149,8 +149,8 @@ namespace std ...@@ -149,8 +149,8 @@ namespace std
{ {
typedef typename iterator_traits<_ForwardIterator>::value_type typedef typename iterator_traits<_ForwardIterator>::value_type
_Value_type; _Value_type;
typedef typename __type_traits<_Value_type>::has_trivial_destructor typedef typename std::__is_scalar<_Value_type>::__type
_Has_trivial_destructor; _Has_trivial_destructor;
std::__destroy_aux(__first, __last, _Has_trivial_destructor()); std::__destroy_aux(__first, __last, _Has_trivial_destructor());
} }
......
// Deque implementation -*- C++ -*- // Deque implementation -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -702,7 +702,7 @@ namespace _GLIBCXX_STD ...@@ -702,7 +702,7 @@ namespace _GLIBCXX_STD
: _Base(__a) : _Base(__a)
{ {
// Check whether it's an integral type. If so, it's not an iterator. // Check whether it's an integral type. If so, it's not an iterator.
typedef typename _Is_integer<_InputIterator>::_Integral _Integral; typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_initialize_dispatch(__first, __last, _Integral()); _M_initialize_dispatch(__first, __last, _Integral());
} }
...@@ -755,7 +755,7 @@ namespace _GLIBCXX_STD ...@@ -755,7 +755,7 @@ namespace _GLIBCXX_STD
void void
assign(_InputIterator __first, _InputIterator __last) assign(_InputIterator __first, _InputIterator __last)
{ {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral; typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_assign_dispatch(__first, __last, _Integral()); _M_assign_dispatch(__first, __last, _Integral());
} }
...@@ -1131,7 +1131,7 @@ namespace _GLIBCXX_STD ...@@ -1131,7 +1131,7 @@ namespace _GLIBCXX_STD
_InputIterator __last) _InputIterator __last)
{ {
// Check whether it's an integral type. If so, it's not an iterator. // Check whether it's an integral type. If so, it's not an iterator.
typedef typename _Is_integer<_InputIterator>::_Integral _Integral; typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_insert_dispatch(__position, __first, __last, _Integral()); _M_insert_dispatch(__position, __first, __last, _Integral());
} }
......
...@@ -561,7 +561,7 @@ namespace _GLIBCXX_STD ...@@ -561,7 +561,7 @@ namespace _GLIBCXX_STD
assign(_InputIterator __first, _InputIterator __last) assign(_InputIterator __first, _InputIterator __last)
{ {
// Check whether it's an integral type. If so, it's not an iterator. // Check whether it's an integral type. If so, it's not an iterator.
typedef typename _Is_integer<_InputIterator>::_Integral _Integral; typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_assign_dispatch(__first, __last, _Integral()); _M_assign_dispatch(__first, __last, _Integral());
} }
...@@ -838,7 +838,7 @@ namespace _GLIBCXX_STD ...@@ -838,7 +838,7 @@ namespace _GLIBCXX_STD
_InputIterator __last) _InputIterator __last)
{ {
// Check whether it's an integral type. If so, it's not an iterator. // Check whether it's an integral type. If so, it's not an iterator.
typedef typename _Is_integer<_InputIterator>::_Integral _Integral; typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_insert_dispatch(__position, __first, __last, _Integral()); _M_insert_dispatch(__position, __first, __last, _Integral());
} }
......
// Temporary buffer implementation -*- C++ -*- // Temporary buffer implementation -*- C++ -*-
// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -145,8 +145,7 @@ namespace std ...@@ -145,8 +145,7 @@ namespace std
_M_len(0), _M_buffer(0) _M_len(0), _M_buffer(0)
{ {
// Workaround for a __type_traits bug in the pre-7.3 compiler. // Workaround for a __type_traits bug in the pre-7.3 compiler.
typedef typename __type_traits<_Tp>::has_trivial_default_constructor typedef typename std::__is_scalar<_Tp>::__type _Trivial;
_Trivial;
try try
{ {
......
// Raw memory manipulators -*- C++ -*- // Raw memory manipulators -*- C++ -*-
// Copyright (C) 2001, 2004 Free Software Foundation, Inc. // Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -108,7 +108,7 @@ namespace std ...@@ -108,7 +108,7 @@ namespace std
_ForwardIterator __result) _ForwardIterator __result)
{ {
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD; typedef typename std::__is_scalar<_ValueType>::__type _Is_POD;
return std::__uninitialized_copy_aux(__first, __last, __result, return std::__uninitialized_copy_aux(__first, __last, __result,
_Is_POD()); _Is_POD());
} }
...@@ -170,7 +170,7 @@ namespace std ...@@ -170,7 +170,7 @@ namespace std
const _Tp& __x) const _Tp& __x)
{ {
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD; typedef typename std::__is_scalar<_ValueType>::__type _Is_POD;
std::__uninitialized_fill_aux(__first, __last, __x, _Is_POD()); std::__uninitialized_fill_aux(__first, __last, __x, _Is_POD());
} }
...@@ -214,7 +214,7 @@ namespace std ...@@ -214,7 +214,7 @@ namespace std
uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x) uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
{ {
typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType;
typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD; typedef typename std::__is_scalar<_ValueType>::__type _Is_POD;
std::__uninitialized_fill_n_aux(__first, __n, __x, _Is_POD()); std::__uninitialized_fill_n_aux(__first, __n, __x, _Is_POD());
} }
......
// Vector implementation -*- C++ -*- // Vector implementation -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -259,7 +259,7 @@ namespace _GLIBCXX_STD ...@@ -259,7 +259,7 @@ namespace _GLIBCXX_STD
: _Base(__a) : _Base(__a)
{ {
// Check whether it's an integral type. If so, it's not an iterator. // Check whether it's an integral type. If so, it's not an iterator.
typedef typename _Is_integer<_InputIterator>::_Integral _Integral; typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_initialize_dispatch(__first, __last, _Integral()); _M_initialize_dispatch(__first, __last, _Integral());
} }
...@@ -316,7 +316,7 @@ namespace _GLIBCXX_STD ...@@ -316,7 +316,7 @@ namespace _GLIBCXX_STD
assign(_InputIterator __first, _InputIterator __last) assign(_InputIterator __first, _InputIterator __last)
{ {
// Check whether it's an integral type. If so, it's not an iterator. // Check whether it's an integral type. If so, it's not an iterator.
typedef typename _Is_integer<_InputIterator>::_Integral _Integral; typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_assign_dispatch(__first, __last, _Integral()); _M_assign_dispatch(__first, __last, _Integral());
} }
...@@ -677,7 +677,7 @@ namespace _GLIBCXX_STD ...@@ -677,7 +677,7 @@ namespace _GLIBCXX_STD
_InputIterator __last) _InputIterator __last)
{ {
// Check whether it's an integral type. If so, it's not an iterator. // Check whether it's an integral type. If so, it's not an iterator.
typedef typename _Is_integer<_InputIterator>::_Integral _Integral; typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_insert_dispatch(__position, __first, __last, _Integral()); _M_insert_dispatch(__position, __first, __last, _Integral());
} }
......
// Debugging support implementation -*- C++ -*- // Debugging support implementation -*- C++ -*-
// Copyright (C) 2003 // Copyright (C) 2003, 2005
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -273,7 +273,7 @@ _GLIBCXX_DEBUG_VERIFY(::std::__is_heap(_First, _Last, _Pred), \ ...@@ -273,7 +273,7 @@ _GLIBCXX_DEBUG_VERIFY(::std::__is_heap(_First, _Last, _Pred), \
#include <stddef.h> // for ptrdiff_t #include <stddef.h> // for ptrdiff_t
#include <bits/stl_iterator_base_types.h> // for iterator_traits, categories #include <bits/stl_iterator_base_types.h> // for iterator_traits, categories
#include <bits/type_traits.h> // for _Is_integer #include <bits/cpp_type_traits.h> // for __is_integer
namespace __gnu_debug namespace __gnu_debug
{ {
...@@ -373,7 +373,7 @@ namespace __gnu_debug ...@@ -373,7 +373,7 @@ namespace __gnu_debug
inline bool inline bool
__valid_range(const _InputIterator& __first, const _InputIterator& __last) __valid_range(const _InputIterator& __first, const _InputIterator& __last)
{ {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral; typedef typename std::__is_integer<_InputIterator>::__type _Integral;
return __gnu_debug::__valid_range_aux(__first, __last, _Integral()); return __gnu_debug::__valid_range_aux(__first, __last, _Integral());
} }
......
// Singly-linked list implementation -*- C++ -*- // Singly-linked list implementation -*- C++ -*-
// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. // Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -403,7 +403,7 @@ namespace __gnu_cxx ...@@ -403,7 +403,7 @@ namespace __gnu_cxx
void void
assign(_InputIterator __first, _InputIterator __last) assign(_InputIterator __first, _InputIterator __last)
{ {
typedef typename _Is_integer<_InputIterator>::_Integral _Integral; typedef typename std::__is_integer<_InputIterator>::__type _Integral;
_M_assign_dispatch(__first, __last, _Integral()); _M_assign_dispatch(__first, __last, _Integral());
} }
...@@ -526,7 +526,7 @@ namespace __gnu_cxx ...@@ -526,7 +526,7 @@ namespace __gnu_cxx
_M_insert_after_range(_Node_base* __pos, _M_insert_after_range(_Node_base* __pos,
_InIterator __first, _InIterator __last) _InIterator __first, _InIterator __last)
{ {
typedef typename _Is_integer<_InIterator>::_Integral _Integral; typedef typename std::__is_integer<_InIterator>::__type _Integral;
_M_insert_after_range(__pos, __first, __last, _Integral()); _M_insert_after_range(__pos, __first, __last, _Integral());
} }
......
// Components for manipulating sequences of characters -*- C++ -*- // Components for manipulating sequences of characters -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include <bits/stringfwd.h> #include <bits/stringfwd.h>
#include <bits/char_traits.h> #include <bits/char_traits.h>
#include <memory> // For allocator. #include <memory> // For allocator.
#include <bits/type_traits.h> #include <bits/cpp_type_traits.h>
#include <iosfwd> // For operators >>, <<, and getline decls. #include <iosfwd> // For operators >>, <<, and getline decls.
#include <bits/stl_iterator.h> #include <bits/stl_iterator.h>
#include <bits/stl_function.h> // For less #include <bits/stl_function.h> // For less
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment