aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/tr1
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2006-09-18 13:30:56 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2006-09-18 13:30:56 +0000
commit105c6331b2b4a1e573bf237eaf9c572e18f8147c (patch)
tree45a99e66079ad8c76c24028341e6552ea91cf361 /libstdc++-v3/include/tr1
parentbcc4a44f6b929d0640370f1dd6aafccba481527c (diff)
downloadgcc-105c6331b2b4a1e573bf237eaf9c572e18f8147c.zip
gcc-105c6331b2b4a1e573bf237eaf9c572e18f8147c.tar.gz
gcc-105c6331b2b4a1e573bf237eaf9c572e18f8147c.tar.bz2
type_traits.h: New.
2006-09-18 Benjamin Kosnik <bkoz@redhat.com> Peter Doerfler <gcc@pdoerfler.com> Paolo Carlini <pcarlini@suse.de> * include/ext/type_traits.h: New. (__conditional_type): New. (__numeric_traits): New. (__add_unsigned): New. (__remove_unsigned): New. (__enable_if): New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * include/ext/pb_ds/detail/type_utils.hpp: Use ext include, remove duplicates. * include/tr1/hashtable_policy.h (IF): Use __conditional_type. (_Max_digits10): Same. (identity): Use _Identity. (extract1st): Use _Select1st. * include/tr1/random (_Select): Use __conditional_type. (_To_Unsigned_Type): Use __add_unsigned. Linebreak fixups. * include/bits/locale_facets.tcc (__to_unsigned_type): Remove, use __add_unsigned. * include/tr1/random.tcc: Fixups as above. * include/tr1/unordered_map: Same. * include/tr1/hashtable: Same. * include/tr1/unordered_set: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Same. * include/ext/pb_ds/detail/standard_policies.hpp: Same. * include/ext/pb_ds/detail/typelist/typelist_filter.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same. * include/ext/pb_ds/detail/type_utils.hpp: Same. * include/ext/pb_ds/trie_policy.hpp: Same. * docs/html/ext/pb_ds/string_trie_e_access_traits.html: Same. * include/bits/cpp_type_traits.h (__enable_if): Move to ext, make boolean argument first. * include/bits/locale_facets.h: Fixups for __enable_if argument and namespace switch. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/streambuf_iterator.h: Same. * include/debug/safe_iterator.h: Same. * include/tr1/hashtable_policy.h: Same. * include/tr1/cmath: Same. * include/tr1/functional: Same. * include/tr1/functional_iterate.h: Same. * include/std/std_streambuf.h: Same. * include/c_std/std_cmath.h: Same. * testsuite/util/testsuite_tr1.h: Same. * testsuite/util/performance/assoc/multimap_common_type.hpp: Same. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> Co-Authored-By: Peter Doerfler <gcc@pdoerfler.com> From-SVN: r117024
Diffstat (limited to 'libstdc++-v3/include/tr1')
-rw-r--r--libstdc++-v3/include/tr1/cmath9
-rw-r--r--libstdc++-v3/include/tr1/functional2
-rw-r--r--libstdc++-v3/include/tr1/functional_iterate.h35
-rw-r--r--libstdc++-v3/include/tr1/hashtable12
-rw-r--r--libstdc++-v3/include/tr1/hashtable_policy.h51
-rw-r--r--libstdc++-v3/include/tr1/random87
-rw-r--r--libstdc++-v3/include/tr1/random.tcc46
-rw-r--r--libstdc++-v3/include/tr1/unordered_map16
-rw-r--r--libstdc++-v3/include/tr1/unordered_set20
9 files changed, 100 insertions, 178 deletions
diff --git a/libstdc++-v3/include/tr1/cmath b/libstdc++-v3/include/tr1/cmath
index 0f51604..1b9cc8a 100644
--- a/libstdc++-v3/include/tr1/cmath
+++ b/libstdc++-v3/include/tr1/cmath
@@ -371,10 +371,9 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
namespace detail
{
template<typename _Tp, typename _Up>
- inline typename
- std::__enable_if<typename std::tr1::__promote_2<_Tp, _Up>::__type,
- (std::__is_floating<_Tp>::__value
- || std::__is_floating<_Up>::__value)>::__type
+ inline typename __gnu_cxx::__enable_if<std::__is_floating<_Tp>::__value
+ || std::__is_floating<_Up>::__value,
+ typename std::tr1::__promote_2<_Tp, _Up>::__type>::__type
atan2(_Tp __y, _Up __x)
{
typedef typename std::tr1::__promote_2<_Tp, _Up>::__type __type;
@@ -384,7 +383,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
using std::atan2;
using detail::atan2;
-
+
inline float
atanh(float __x)
{ return __builtin_atanhf(__x); }
diff --git a/libstdc++-v3/include/tr1/functional b/libstdc++-v3/include/tr1/functional
index a8e3d3c..b9afe4b 100644
--- a/libstdc++-v3/include/tr1/functional
+++ b/libstdc++-v3/include/tr1/functional
@@ -39,7 +39,7 @@
#include "../functional"
#include <typeinfo>
#include <tr1/type_traits>
-#include <bits/cpp_type_traits.h>
+#include <ext/type_traits.h>
#include <string> // for std::tr1::hash
#include <cstdlib> // for std::abort
#include <cmath> // for std::frexp
diff --git a/libstdc++-v3/include/tr1/functional_iterate.h b/libstdc++-v3/include/tr1/functional_iterate.h
index c29e341..0b039f9 100644
--- a/libstdc++-v3/include/tr1/functional_iterate.h
+++ b/libstdc++-v3/include/tr1/functional_iterate.h
@@ -117,12 +117,10 @@ template<typename _Functor _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
*/
template<typename _Functor _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
inline
- typename __enable_if<
- typename result_of<_Functor(_GLIBCXX_TEMPLATE_ARGS)>::type,
- (!is_member_pointer<_Functor>::value
- && !is_function<_Functor>::value
- && !is_function<typename remove_pointer<_Functor>::type>::value)
- >::__type
+ typename __gnu_cxx::__enable_if<(!is_member_pointer<_Functor>::value
+ && !is_function<_Functor>::value
+ && !is_function<typename remove_pointer<_Functor>::type>::value),
+ typename result_of<_Functor(_GLIBCXX_TEMPLATE_ARGS)>::type>::__type
__invoke(_Functor& __f _GLIBCXX_COMMA _GLIBCXX_REF_PARAMS)
{
return __f(_GLIBCXX_ARGS);
@@ -131,11 +129,10 @@ template<typename _Functor _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
#if _GLIBCXX_NUM_ARGS > 0
template<typename _Functor _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
inline
- typename __enable_if<
- typename result_of<_Functor(_GLIBCXX_TEMPLATE_ARGS)>::type,
- (is_member_pointer<_Functor>::value
- && !is_function<_Functor>::value
- && !is_function<typename remove_pointer<_Functor>::type>::value)
+ typename __gnu_cxx::__enable_if<(is_member_pointer<_Functor>::value
+ && !is_function<_Functor>::value
+ && !is_function<typename remove_pointer<_Functor>::type>::value),
+ typename result_of<_Functor(_GLIBCXX_TEMPLATE_ARGS)>::type
>::__type
__invoke(_Functor& __f _GLIBCXX_COMMA _GLIBCXX_REF_PARAMS)
{
@@ -146,10 +143,9 @@ template<typename _Functor _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
// To pick up function references (that will become function pointers)
template<typename _Functor _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
inline
- typename __enable_if<
- typename result_of<_Functor(_GLIBCXX_TEMPLATE_ARGS)>::type,
- (is_pointer<_Functor>::value
- && is_function<typename remove_pointer<_Functor>::type>::value)
+ typename __gnu_cxx::__enable_if<(is_pointer<_Functor>::value
+ && is_function<typename remove_pointer<_Functor>::type>::value),
+ typename result_of<_Functor(_GLIBCXX_TEMPLATE_ARGS)>::type
>::__type
__invoke(_Functor __f _GLIBCXX_COMMA _GLIBCXX_REF_PARAMS)
{
@@ -667,9 +663,7 @@ class function<_Res(_GLIBCXX_TEMPLATE_ARGS)>
*/
template<typename _Functor>
function(_Functor __f,
- typename __enable_if<_Useless,
- !is_integral<_Functor>::value>::__type
- = _Useless());
+ typename __gnu_cxx::__enable_if<!is_integral<_Functor>::value, _Useless>::__type = _Useless());
/**
* @brief %Function assignment operator.
@@ -723,7 +717,7 @@ class function<_Res(_GLIBCXX_TEMPLATE_ARGS)>
* reference_wrapper<F>, this function will not throw.
*/
template<typename _Functor>
- typename __enable_if<function&, !is_integral<_Functor>::value>::__type
+ typename __gnu_cxx::__enable_if<!is_integral<_Functor>::value, function&>::__type
operator=(_Functor __f)
{
function(__f).swap(*this);
@@ -841,8 +835,7 @@ template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS>
template<typename _Functor>
function<_Res(_GLIBCXX_TEMPLATE_ARGS)>
::function(_Functor __f,
- typename __enable_if<_Useless,
- !is_integral<_Functor>::value>::__type)
+ typename __gnu_cxx::__enable_if<!is_integral<_Functor>::value, _Useless>::__type)
: _Function_base()
{
typedef _Function_handler<_Signature_type, _Functor> _My_handler;
diff --git a/libstdc++-v3/include/tr1/hashtable b/libstdc++-v3/include/tr1/hashtable
index 9a682db..47d04eb 100644
--- a/libstdc++-v3/include/tr1/hashtable
+++ b/libstdc++-v3/include/tr1/hashtable
@@ -347,14 +347,14 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
// have partial specialization of member templates; it would be
// better to just specialize insert on unique_keys. There may be a
// cleaner workaround.
- typedef typename detail::IF<unique_keys,
- std::pair<iterator, bool>, iterator>::type
+ typedef typename __gnu_cxx::__conditional_type<unique_keys,
+ std::pair<iterator, bool>, iterator>::__type
Insert_Return_Type;
- typedef typename detail::IF<unique_keys,
- detail::extract1st<Insert_Return_Type>,
- detail::identity<Insert_Return_Type>
- >::type
+ typedef typename __gnu_cxx::__conditional_type<unique_keys,
+ std::_Select1st<Insert_Return_Type>,
+ std::_Identity<Insert_Return_Type>
+ >::__type
Insert_Conv_Type;
node*
diff --git a/libstdc++-v3/include/tr1/hashtable_policy.h b/libstdc++-v3/include/tr1/hashtable_policy.h
index 57b6e89..076bcce 100644
--- a/libstdc++-v3/include/tr1/hashtable_policy.h
+++ b/libstdc++-v3/include/tr1/hashtable_policy.h
@@ -34,6 +34,10 @@
#ifndef _TR1_HASHTABLE_POLICY_H
#define _TR1_HASHTABLE_POLICY_H 1
+#include <functional> // _Identity, _Select1st
+#include <tr1/utility>
+#include <ext/type_traits.h>
+
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(tr1)
@@ -41,18 +45,6 @@ namespace detail
{
namespace
{
- // General utilities.
- template<bool Flag, typename IfTrue, typename IfFalse>
- struct IF;
-
- template<typename IfTrue, typename IfFalse>
- struct IF<true, IfTrue, IfFalse>
- { typedef IfTrue type; };
-
- template <typename IfTrue, typename IfFalse>
- struct IF<false, IfTrue, IfFalse>
- { typedef IfFalse type; };
-
// Helper function: return distance(first, last) for forward
// iterators, or 0 for input iterators.
template<class Iterator>
@@ -233,9 +225,9 @@ namespace
: public node_iterator_base<Value, cache>
{
typedef Value value_type;
- typedef typename IF<constant_iterators, const Value*, Value*>::type
+ typedef typename __gnu_cxx::__conditional_type<constant_iterators, const Value*, Value*>::__type
pointer;
- typedef typename IF<constant_iterators, const Value&, Value&>::type
+ typedef typename __gnu_cxx::__conditional_type<constant_iterators, const Value&, Value&>::__type
reference;
typedef std::ptrdiff_t difference_type;
typedef std::forward_iterator_tag iterator_category;
@@ -370,9 +362,9 @@ namespace
: public hashtable_iterator_base<Value, cache>
{
typedef Value value_type;
- typedef typename IF<constant_iterators, const Value*, Value*>::type
+ typedef typename __gnu_cxx::__conditional_type<constant_iterators, const Value*, Value*>::__type
pointer;
- typedef typename IF<constant_iterators, const Value&, Value&>::type
+ typedef typename __gnu_cxx::__conditional_type<constant_iterators, const Value&, Value&>::__type
reference;
typedef std::ptrdiff_t difference_type;
typedef std::forward_iterator_tag iterator_category;
@@ -465,25 +457,6 @@ namespace
// Many of class template hashtable's template parameters are policy
// classes. These are defaults for the policies.
- // The two key extraction policies used by the *set and *map variants.
- // XXX pb_ds::type_to_type
- template<typename T>
- struct identity
- {
- const T&
- operator()(const T& t) const
- { return t; }
- };
-
- // XXX use std::_Select1st?
- template<typename Pair>
- struct extract1st
- {
- const typename Pair::first_type&
- operator()(const Pair& p) const
- { return p.first; }
- };
-
// Default range hashing function: use division to fold a large number
// into the range [0, N).
struct mod_range_hashing
@@ -624,13 +597,13 @@ namespace
struct map_base { };
template<typename K, typename Pair, typename Hashtable>
- struct map_base<K, Pair, extract1st<Pair>, false, Hashtable>
+ struct map_base<K, Pair, std::_Select1st<Pair>, false, Hashtable>
{
typedef typename Pair::second_type mapped_type;
};
template<typename K, typename Pair, typename Hashtable>
- struct map_base<K, Pair, extract1st<Pair>, true, Hashtable>
+ struct map_base<K, Pair, std::_Select1st<Pair>, true, Hashtable>
{
typedef typename Pair::second_type mapped_type;
@@ -639,8 +612,8 @@ namespace
};
template<typename K, typename Pair, typename Hashtable>
- typename map_base<K, Pair, extract1st<Pair>, true, Hashtable>::mapped_type&
- map_base<K, Pair, extract1st<Pair>, true, Hashtable>::
+ typename map_base<K, Pair, std::_Select1st<Pair>, true, Hashtable>::mapped_type&
+ map_base<K, Pair, std::_Select1st<Pair>, true, Hashtable>::
operator[](const K& k)
{
Hashtable* h = static_cast<Hashtable*>(this);
diff --git a/libstdc++-v3/include/tr1/random b/libstdc++-v3/include/tr1/random
index 8ffdf16..b926c5b 100644
--- a/libstdc++-v3/include/tr1/random
+++ b/libstdc++-v3/include/tr1/random
@@ -37,7 +37,6 @@
#include <algorithm>
#include <bits/concept_check.h>
-#include <bits/cpp_type_traits.h>
#include <cmath>
#include <debug/debug.h>
#include <iterator>
@@ -46,6 +45,7 @@
#include <tr1/type_traits>
#include <tr1/cmath>
#include <fstream>
+#include <ext/type_traits.h>
namespace std
{
@@ -64,17 +64,8 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
*/
namespace
{
- // Type selectors -- are these already implemented elsewhere?
- template<bool, typename _TpTrue, typename _TpFalse>
- struct _Select
- { typedef _TpTrue _Type; };
-
- template<typename _TpTrue, typename _TpFalse>
- struct _Select<false, _TpTrue, _TpFalse>
- { typedef _TpFalse _Type; };
-
- template<typename _UIntType, int __w, bool =
- __w < std::numeric_limits<_UIntType>::digits>
+ template<typename _UIntType, int __w,
+ bool = __w < std::numeric_limits<_UIntType>::digits>
struct _Shift
{ static const _UIntType __value = 0; };
@@ -92,11 +83,8 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
__mod(_Tp __x)
{ return _Mod<_Tp, __a, __c, __m, __m == 0>::__calc(__x); }
- template<typename _ValueT>
- struct _To_Unsigned_Type;
-
- typedef _Select<(sizeof(unsigned) == 4),
- unsigned, unsigned long>::_Type _UInt32Type;
+ typedef __gnu_cxx::__conditional_type<(sizeof(unsigned) == 4),
+ unsigned, unsigned long>::__type _UInt32Type;
} // anonymous namespace
/*
@@ -193,9 +181,8 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
typedef typename _Dist::result_type result_type;
// tr1:5.1.1 table 5.1 requirement
- typedef typename std::__enable_if<result_type,
- is_arithmetic<result_type>::value
- >::__type _IsValidType;
+ typedef typename __gnu_cxx::__enable_if<
+ is_arithmetic<result_type>::value, result_type>::__type _IsValidType;
public:
/**
@@ -277,20 +264,19 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
* @addtogroup tr1_random_generators Random Number Generators
* @ingroup tr1_random
*
- * These classes define objects which provide random or pseudorandom numbers,
- * either from a discrete or a continuous interval. The random number
- * generator supplied as a part of this library are all uniform random number
- * generators which provide a sequence of random number uniformly distributed
- * over their range.
+ * These classes define objects which provide random or pseudorandom
+ * numbers, either from a discrete or a continuous interval. The
+ * random number generator supplied as a part of this library are
+ * all uniform random number generators which provide a sequence of
+ * random number uniformly distributed over their range.
*
- * A number generator is a function object with an operator() that takes zero
- * arguments and returns a number.
+ * A number generator is a function object with an operator() that
+ * takes zero arguments and returns a number.
*
- * A compliant random number generator must satisy the following requirements.
- * <table border=1 cellpadding=10 cellspacing=0>
+ * A compliant random number generator must satisy the following
+ * requirements. <table border=1 cellpadding=10 cellspacing=0>
* <caption align=top>Random Number Generator Requirements</caption>
- * <tr><td>To be documented.</td></tr>
- * </table>
+ * <tr><td>To be documented.</td></tr> </table>
*
* @{
*/
@@ -704,8 +690,9 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
* This is a model of a Generalized Fibonacci discrete random number
* generator, sometimes referred to as the SWC generator.
*
- * A discrete random number generator that produces pseudorandom numbers using
- * @f$x_{i}\leftarrow(x_{i - s} - x_{i - r} - carry_{i-1}) \bmod m @f$.
+ * A discrete random number generator that produces pseudorandom
+ * numbers using @f$x_{i}\leftarrow(x_{i - s} - x_{i - r} -
+ * carry_{i-1}) \bmod m @f$.
*
* The size of the state is @f$ r @f$
* and the maximum period of the generator is @f$ m^r - m^s -1 @f$.
@@ -777,13 +764,13 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
/**
* Seeds the initial state @f$ x_0 @f$ of the random number generator.
*
- * N1688[4.19] modifies this as follows.
- * If @p __value == 0, sets value to 19780503. In any case, with a linear
+ * N1688[4.19] modifies this as follows. If @p __value == 0,
+ * sets value to 19780503. In any case, with a linear
* congruential generator lcg(i) having parameters @f$ m_{lcg} =
- * 2147483563, a_{lcg} = 40014, c_{lcg} = 0, and lcg(0) = value @f$, sets
- * @f$ x_{-r} \dots x_{-1} @f$ to
- * @f$ lcg(1) \bmod m \dots lcg(r) \bmod m @f$ respectively.
- * If @f$ x_{-1} = 0 @f$ set carry to 1, otherwise sets carry to 0.
+ * 2147483563, a_{lcg} = 40014, c_{lcg} = 0, and lcg(0) = value
+ * @f$, sets @f$ x_{-r} \dots x_{-1} @f$ to @f$ lcg(1) \bmod m
+ * \dots lcg(r) \bmod m @f$ respectively. If @f$ x_{-1} = 0 @f$
+ * set carry to 1, otherwise sets carry to 0.
*/
void
seed(unsigned long __value = 19780503);
@@ -893,7 +880,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
seed(_Gen& __g, false_type);
private:
- typedef typename _To_Unsigned_Type<_IntType>::_Type _UIntType;
+ typedef typename __gnu_cxx::__add_unsigned<_IntType>::__type _UIntType;
_UIntType _M_x[long_lag];
_UIntType _M_carry;
@@ -1014,7 +1001,8 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
* Compares two % subtract_with_carry_01 random number generator objects
* of the same type for equality.
*
- * @param __lhs A % subtract_with_carry_01 random number generator object.
+ * @param __lhs A % subtract_with_carry_01 random number
+ * generator object.
* @param __rhs Another % subtract_with_carry_01 random number generator
* object.
*
@@ -1035,7 +1023,9 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
* Compares two % subtract_with_carry_01 random number generator objects
* of the same type for inequality.
*
- * @param __lhs A % subtract_with_carry_01 random number generator object.
+ * @param __lhs A % subtract_with_carry_01 random number
+ * generator object.
+ *
* @param __rhs Another % subtract_with_carry_01 random number generator
* object.
*
@@ -1376,8 +1366,8 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
public:
/** The type of the generated random value. */
- typedef typename _Select<(sizeof(_Result_type1) > sizeof(_Result_type2)),
- _Result_type1, _Result_type2>::_Type result_type;
+ typedef typename __gnu_cxx::__conditional_type<(sizeof(_Result_type1) > sizeof(_Result_type2)),
+ _Result_type1, _Result_type2>::__type result_type;
// parameter values
static const int shift1 = __s1;
@@ -1518,8 +1508,8 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
/**
- * A standard interface to a platform-specific non-deterministic random number
- * generator (if any are available).
+ * A standard interface to a platform-specific non-deterministic
+ * random number generator (if any are available).
*/
class random_device
{
@@ -2091,7 +2081,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const _RealType& __p = _RealType(0.5))
: _M_t(__t), _M_p(__p), _M_nd()
{
- _GLIBCXX_DEBUG_ASSERT((_M_t >= 0) && (_M_p >= 0.0) && (_M_p <= 1.0));
+ _GLIBCXX_DEBUG_ASSERT((_M_t >= 0) && (_M_p >= 0.0) && (_M_p <= 1.0));
_M_initialize();
}
@@ -2355,7 +2345,8 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
* @p __x from the input stream @p __is.
*
* @param __is An input stream.
- * @param __x A %exponential_distribution random number generator engine.
+ * @param __x A %exponential_distribution random number
+ * generator engine.
*
* @returns The input stream with @p __x extracted or in an error state.
*/
diff --git a/libstdc++-v3/include/tr1/random.tcc b/libstdc++-v3/include/tr1/random.tcc
index a732260..fd052fe 100644
--- a/libstdc++-v3/include/tr1/random.tcc
+++ b/libstdc++-v3/include/tr1/random.tcc
@@ -86,36 +86,6 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
__calc(_Tp __x)
{ return __a * __x + __c; }
};
-
- template<typename _ValueT>
- struct _To_Unsigned_Type
- { typedef _ValueT _Type; };
-
- template<>
- struct _To_Unsigned_Type<short>
- { typedef unsigned short _Type; };
-
- template<>
- struct _To_Unsigned_Type<int>
- { typedef unsigned int _Type; };
-
- template<>
- struct _To_Unsigned_Type<long>
- { typedef unsigned long _Type; };
-
-#ifdef _GLIBCXX_USE_LONG_LONG
- template<>
- struct _To_Unsigned_Type<long long>
- { typedef unsigned long long _Type; };
-#endif
-
- // See N1822.
- template<typename _RealType>
- struct _Max_digits10
- {
- static const std::streamsize __value =
- 2 + std::numeric_limits<_RealType>::digits * 3010/10000;
- };
} // anonymous namespace
@@ -758,7 +728,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const std::streamsize __precision = __os.precision();
__os.flags(std::ios_base::scientific | std::ios_base::left);
__os.fill(__os.widen(' '));
- __os.precision(_Max_digits10<double>::__value);
+ __os.precision(__gnu_cxx::__numeric_traits<double>::__max_digits10);
__os << __x.p();
@@ -780,7 +750,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const std::streamsize __precision = __os.precision();
__os.flags(std::ios_base::scientific | std::ios_base::left);
__os.fill(__os.widen(' '));
- __os.precision(_Max_digits10<_RealType>::__value);
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
__os << __x.p();
@@ -932,7 +902,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const _CharT __space = __os.widen(' ');
__os.flags(std::ios_base::scientific | std::ios_base::left);
__os.fill(__space);
- __os.precision(_Max_digits10<_RealType>::__value);
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
__os << __x.mean() << __space << __x._M_nd;
@@ -1156,7 +1126,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const _CharT __space = __os.widen(' ');
__os.flags(std::ios_base::scientific | std::ios_base::left);
__os.fill(__space);
- __os.precision(_Max_digits10<_RealType>::__value);
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
__os << __x.t() << __space << __x.p()
<< __space << __x._M_nd;
@@ -1195,7 +1165,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const _CharT __space = __os.widen(' ');
__os.flags(std::ios_base::scientific | std::ios_base::left);
__os.fill(__space);
- __os.precision(_Max_digits10<_RealType>::__value);
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
__os << __x.min() << __space << __x.max();
@@ -1230,7 +1200,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const std::streamsize __precision = __os.precision();
__os.flags(std::ios_base::scientific | std::ios_base::left);
__os.fill(__os.widen(' '));
- __os.precision(_Max_digits10<_RealType>::__value);
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
__os << __x.lambda();
@@ -1292,7 +1262,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const _CharT __space = __os.widen(' ');
__os.flags(std::ios_base::scientific | std::ios_base::left);
__os.fill(__space);
- __os.precision(_Max_digits10<_RealType>::__value);
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
__os << __x._M_saved_available << __space
<< __x.mean() << __space
@@ -1418,7 +1388,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const std::streamsize __precision = __os.precision();
__os.flags(std::ios_base::scientific | std::ios_base::left);
__os.fill(__os.widen(' '));
- __os.precision(_Max_digits10<_RealType>::__value);
+ __os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
__os << __x.alpha();
diff --git a/libstdc++-v3/include/tr1/unordered_map b/libstdc++-v3/include/tr1/unordered_map
index 6754941..58aaa08 100644
--- a/libstdc++-v3/include/tr1/unordered_map
+++ b/libstdc++-v3/include/tr1/unordered_map
@@ -50,14 +50,14 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
bool cache_hash_code = false>
class unordered_map
: public hashtable<Key, std::pair<const Key, T>, Alloc,
- detail::extract1st<std::pair<const Key, T> >, Pred,
+ std::_Select1st<std::pair<const Key, T> >, Pred,
Hash, detail::mod_range_hashing,
detail::default_ranged_hash,
detail::prime_rehash_policy,
cache_hash_code, false, true>
{
typedef hashtable<Key, std::pair<const Key, T>, Alloc,
- detail::extract1st<std::pair<const Key, T> >, Pred,
+ std::_Select1st<std::pair<const Key, T> >, Pred,
Hash, detail::mod_range_hashing,
detail::default_ranged_hash,
detail::prime_rehash_policy,
@@ -77,7 +77,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const allocator_type& a = allocator_type())
: Base(n, hf, detail::mod_range_hashing(),
detail::default_ranged_hash(),
- eql, detail::extract1st<std::pair<const Key, T> >(), a)
+ eql, std::_Select1st<std::pair<const Key, T> >(), a)
{ }
template<typename InputIterator>
@@ -88,7 +88,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const allocator_type& a = allocator_type())
: Base (f, l, n, hf, detail::mod_range_hashing(),
detail::default_ranged_hash(),
- eql, detail::extract1st<std::pair<const Key, T> >(), a)
+ eql, std::_Select1st<std::pair<const Key, T> >(), a)
{ }
};
@@ -100,7 +100,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
class unordered_multimap
: public hashtable <Key, std::pair<const Key, T>,
Alloc,
- detail::extract1st<std::pair<const Key, T> >, Pred,
+ std::_Select1st<std::pair<const Key, T> >, Pred,
Hash, detail::mod_range_hashing,
detail::default_ranged_hash,
detail::prime_rehash_policy,
@@ -108,7 +108,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
{
typedef hashtable <Key, std::pair<const Key, T>,
Alloc,
- detail::extract1st<std::pair<const Key, T> >, Pred,
+ std::_Select1st<std::pair<const Key, T> >, Pred,
Hash, detail::mod_range_hashing,
detail::default_ranged_hash,
detail::prime_rehash_policy,
@@ -128,7 +128,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const allocator_type& a = allocator_type())
: Base (n, hf, detail::mod_range_hashing(),
detail::default_ranged_hash(),
- eql, detail::extract1st<std::pair<const Key, T> >(), a)
+ eql, std::_Select1st<std::pair<const Key, T> >(), a)
{ }
@@ -140,7 +140,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const allocator_type& a = allocator_type())
: Base (f, l, n, hf, detail::mod_range_hashing(),
detail::default_ranged_hash(),
- eql, detail::extract1st<std::pair<const Key, T> >(), a)
+ eql, std::_Select1st<std::pair<const Key, T> >(), a)
{ }
};
diff --git a/libstdc++-v3/include/tr1/unordered_set b/libstdc++-v3/include/tr1/unordered_set
index f3c7227..b537d74 100644
--- a/libstdc++-v3/include/tr1/unordered_set
+++ b/libstdc++-v3/include/tr1/unordered_set
@@ -50,14 +50,14 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
bool cache_hash_code = false>
class unordered_set
: public hashtable<Value, Value, Alloc,
- detail::identity<Value>, Pred,
+ std::_Identity<Value>, Pred,
Hash, detail::mod_range_hashing,
detail::default_ranged_hash,
detail::prime_rehash_policy,
cache_hash_code, true, true>
{
typedef hashtable<Value, Value, Alloc,
- detail::identity<Value>, Pred,
+ std::_Identity<Value>, Pred,
Hash, detail::mod_range_hashing,
detail::default_ranged_hash,
detail::prime_rehash_policy,
@@ -76,8 +76,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const key_equal& eql = key_equal(),
const allocator_type& a = allocator_type())
: Base(n, hf, detail::mod_range_hashing(),
- detail::default_ranged_hash(),
- eql, detail::identity<Value>(), a)
+ detail::default_ranged_hash(), eql, std::_Identity<Value>(), a)
{ }
template<typename InputIterator>
@@ -87,8 +86,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const key_equal& eql = key_equal(),
const allocator_type& a = allocator_type())
: Base(f, l, n, hf, detail::mod_range_hashing(),
- detail::default_ranged_hash(),
- eql, detail::identity<Value>(), a)
+ detail::default_ranged_hash(), eql, std::_Identity<Value>(), a)
{ }
};
@@ -99,14 +97,14 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
bool cache_hash_code = false>
class unordered_multiset
: public hashtable <Value, Value, Alloc,
- detail::identity<Value>, Pred,
+ std::_Identity<Value>, Pred,
Hash, detail::mod_range_hashing,
detail::default_ranged_hash,
detail::prime_rehash_policy,
cache_hash_code, true, false>
{
typedef hashtable<Value, Value, Alloc,
- detail::identity<Value>, Pred,
+ std::_Identity<Value>, Pred,
Hash, detail::mod_range_hashing,
detail::default_ranged_hash,
detail::prime_rehash_policy,
@@ -125,8 +123,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const key_equal& eql = key_equal(),
const allocator_type& a = allocator_type())
: Base(n, hf, detail::mod_range_hashing(),
- detail::default_ranged_hash(),
- eql, detail::identity<Value>(), a)
+ detail::default_ranged_hash(), eql, std::_Identity<Value>(), a)
{ }
@@ -137,8 +134,7 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1)
const key_equal& eql = key_equal(),
const allocator_type& a = allocator_type())
: Base(f, l, n, hf, detail::mod_range_hashing(),
- detail::default_ranged_hash(), eql,
- detail::identity<Value>(), a)
+ detail::default_ranged_hash(), eql, std::_Identity<Value>(), a)
{ }
};