This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] Rename _M_type -> __value
- From: Paolo Carlini <pcarlini at suse dot de>
- To: "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 01 Feb 2005 14:39:55 +0100
- Subject: [v3] Rename _M_type -> __value
Hi,
a trivial follow-up to the cpp_type_traits patch.
Tested x86-linux.
Paolo.
//////////////
2005-02-01 Paolo Carlini <pcarlini@suse.de>
* include/bits/cpp_type_traits.h: Rename _M_type fields to
__value, except for __enable_if, _M_type -> __type, consistently
with the other traits.
* include/bits/stl_algobase.h: Tweak consistently.
* include/bits/stl_tree.h: Likewise.
* include/bits/valarray_array.h: Likewise.
* include/c_std/std_cmath.h: Likewise.
* include/debug/safe_iterator.h: Likewise.
* include/std/std_complex.h: Likewise.
diff -urN libstdc++-v3-orig/include/bits/cpp_type_traits.h libstdc++-v3/include/bits/cpp_type_traits.h
--- libstdc++-v3-orig/include/bits/cpp_type_traits.h 2005-01-31 17:21:55.000000000 +0100
+++ libstdc++-v3/include/bits/cpp_type_traits.h 2005-02-01 14:05:55.000000000 +0100
@@ -77,10 +77,10 @@
typedef char __one;
typedef char __two[2];
- template <typename _Tp>
- __one __test_type (int _Tp::*);
- template <typename _Tp>
- __two& __test_type (...);
+ template<typename _Tp>
+ __one __test_type(int _Tp::*);
+ template<typename _Tp>
+ __two& __test_type(...);
} // namespace __gnu_internal
// Forward declaration hack, should really include this from somewhere.
@@ -106,27 +106,23 @@
template<class _Sp, class _Tp>
struct __traitor
{
- enum { _M_type = _Sp::_M_type || _Tp::_M_type };
- typedef typename __truth_type<_M_type>::__type __type;
+ enum { __value = _Sp::__value || _Tp::__value };
+ typedef typename __truth_type<__value>::__type __type;
};
// Compare for equality of types.
template<typename, typename>
struct __are_same
{
- enum
- {
- _M_type = 0
- };
+ enum { __value = 0 };
+ typedef __false_type __type;
};
template<typename _Tp>
struct __are_same<_Tp, _Tp>
{
- enum
- {
- _M_type = 1
- };
+ enum { __value = 1 };
+ typedef __true_type __type;
};
// Define a nested type if some predicate holds.
@@ -138,21 +134,21 @@
template<typename _Tp>
struct __enable_if<_Tp, true>
{
- typedef _Tp _M_type;
+ typedef _Tp __type;
};
// Holds if the template-argument is a void type.
template<typename _Tp>
struct __is_void
{
- enum { _M_type = 0 };
+ enum { __value = 0 };
typedef __false_type __type;
};
template<>
struct __is_void<void>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
@@ -162,7 +158,7 @@
template<typename _Tp>
struct __is_integer
{
- enum { _M_type = 0 };
+ enum { __value = 0 };
typedef __false_type __type;
};
@@ -172,28 +168,28 @@
template<>
struct __is_integer<bool>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<char>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<signed char>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<unsigned char>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
@@ -201,7 +197,7 @@
template<>
struct __is_integer<wchar_t>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
# endif
@@ -209,56 +205,56 @@
template<>
struct __is_integer<short>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<unsigned short>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<int>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<unsigned int>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<long>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<unsigned long>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<long long>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_integer<unsigned long long>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
@@ -268,7 +264,7 @@
template<typename _Tp>
struct __is_floating
{
- enum { _M_type = 0 };
+ enum { __value = 0 };
typedef __false_type __type;
};
@@ -276,21 +272,21 @@
template<>
struct __is_floating<float>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_floating<double>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
template<>
struct __is_floating<long double>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
@@ -300,14 +296,14 @@
template<typename _Tp>
struct __is_pointer
{
- enum { _M_type = 0 };
+ enum { __value = 0 };
typedef __false_type __type;
};
template<typename _Tp>
struct __is_pointer<_Tp*>
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
@@ -317,7 +313,7 @@
template<typename _Tp>
struct __is_normal_iterator
{
- enum { _M_type = 0 };
+ enum { __value = 0 };
typedef __false_type __type;
};
@@ -325,7 +321,7 @@
struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
_Container> >
{
- enum { _M_type = 1 };
+ enum { __value = 1 };
typedef __true_type __type;
};
@@ -361,7 +357,7 @@
{
enum
{
- _M_type = (sizeof(__gnu_internal::__test_type<_Tp>(0))
+ __value = (sizeof(__gnu_internal::__test_type<_Tp>(0))
!= sizeof(__gnu_internal::__one))
};
};
diff -urN libstdc++-v3-orig/include/bits/stl_algobase.h libstdc++-v3/include/bits/stl_algobase.h
--- libstdc++-v3-orig/include/bits/stl_algobase.h 2005-01-10 18:07:47.000000000 +0100
+++ libstdc++-v3/include/bits/stl_algobase.h 2005-02-01 13:55:55.000000000 +0100
@@ -155,7 +155,7 @@
_ValueType2>)
__glibcxx_function_requires(_ConvertibleConcept<_ValueType2,
_ValueType1>)
- std::__iter_swap<__are_same<_ValueType1, _ValueType2>::_M_type>::
+ std::__iter_swap<__are_same<_ValueType1, _ValueType2>::__value>::
iter_swap(__a, __b);
}
@@ -302,10 +302,10 @@
typedef typename iterator_traits<_II>::value_type _ValueTypeI;
typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
typedef typename iterator_traits<_II>::iterator_category _Category;
- const bool __simple = (__is_scalar<_ValueTypeI>::_M_type
- && __is_pointer<_II>::_M_type
- && __is_pointer<_OI>::_M_type
- && __are_same<_ValueTypeI, _ValueTypeO>::_M_type);
+ const bool __simple = (__is_scalar<_ValueTypeI>::__value
+ && __is_pointer<_II>::__value
+ && __is_pointer<_OI>::__value
+ && __are_same<_ValueTypeI, _ValueTypeO>::__value);
return std::__copy<__simple, _Category>::copy(__first, __last, __result);
}
@@ -374,8 +374,8 @@
typename iterator_traits<_InputIterator>::value_type>)
__glibcxx_requires_valid_range(__first, __last);
- const bool __in = __is_normal_iterator<_InputIterator>::_M_type;
- const bool __out = __is_normal_iterator<_OutputIterator>::_M_type;
+ const bool __in = __is_normal_iterator<_InputIterator>::__value;
+ const bool __out = __is_normal_iterator<_OutputIterator>::__value;
return std::__copy_normal<__in, __out>::copy_n(__first, __last,
__result);
}
@@ -427,10 +427,10 @@
typedef typename iterator_traits<_BI1>::value_type _ValueType1;
typedef typename iterator_traits<_BI2>::value_type _ValueType2;
typedef typename iterator_traits<_BI1>::iterator_category _Category;
- const bool __simple = (__is_scalar<_ValueType1>::_M_type
- && __is_pointer<_BI1>::_M_type
- && __is_pointer<_BI2>::_M_type
- && __are_same<_ValueType1, _ValueType2>::_M_type);
+ const bool __simple = (__is_scalar<_ValueType1>::__value
+ && __is_pointer<_BI1>::__value
+ && __is_pointer<_BI2>::__value
+ && __are_same<_ValueType1, _ValueType2>::__value);
return std::__copy_backward<__simple, _Category>::copy_b(__first, __last,
__result);
@@ -504,8 +504,8 @@
typename iterator_traits<_BI2>::value_type>)
__glibcxx_requires_valid_range(__first, __last);
- const bool __bi1 = __is_normal_iterator<_BI1>::_M_type;
- const bool __bi2 = __is_normal_iterator<_BI2>::_M_type;
+ const bool __bi1 = __is_normal_iterator<_BI1>::__value;
+ const bool __bi2 = __is_normal_iterator<_BI2>::__value;
return std::__copy_backward_normal<__bi1, __bi2>::copy_b_n(__first, __last,
__result);
}
@@ -557,7 +557,7 @@
_ForwardIterator>)
__glibcxx_requires_valid_range(__first, __last);
- const bool __scalar = __is_scalar<_Tp>::_M_type;
+ const bool __scalar = __is_scalar<_Tp>::__value;
std::__fill<__scalar>::fill(__first, __last, __value);
}
@@ -631,7 +631,7 @@
// concept requirements
__glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, _Tp>)
- const bool __scalar = __is_scalar<_Tp>::_M_type;
+ const bool __scalar = __is_scalar<_Tp>::__value;
return std::__fill_n<__scalar>::fill_n(__first, __n, __value);
}
diff -urN libstdc++-v3-orig/include/bits/stl_tree.h libstdc++-v3/include/bits/stl_tree.h
--- libstdc++-v3-orig/include/bits/stl_tree.h 2005-01-21 02:23:27.000000000 +0100
+++ libstdc++-v3/include/bits/stl_tree.h 2005-02-01 13:59:40.000000000 +0100
@@ -392,7 +392,7 @@
protected:
template<typename _Key_compare,
- bool _Is_pod_comparator = std::__is_pod<_Key_compare>::_M_type>
+ bool _Is_pod_comparator = std::__is_pod<_Key_compare>::__value>
struct _Rb_tree_impl : public _Node_allocator
{
_Key_compare _M_key_compare;
diff -urN libstdc++-v3-orig/include/bits/valarray_array.h libstdc++-v3/include/bits/valarray_array.h
--- libstdc++-v3-orig/include/bits/valarray_array.h 2004-08-16 16:50:31.000000000 +0200
+++ libstdc++-v3/include/bits/valarray_array.h 2005-02-01 13:59:07.000000000 +0100
@@ -1,6 +1,6 @@
// The template and inlines for the -*- C++ -*- internal _Array helper class.
-// Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -98,7 +98,7 @@
inline void
__valarray_default_construct(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
{
- _Array_default_ctor<_Tp, __is_fundamental<_Tp>::_M_type>::
+ _Array_default_ctor<_Tp, __is_fundamental<_Tp>::__value>::
_S_do_it(__b, __e);
}
@@ -134,7 +134,7 @@
__valarray_fill_construct(_Tp* __restrict__ __b, _Tp* __restrict__ __e,
const _Tp __t)
{
- _Array_init_ctor<_Tp, __is_fundamental<_Tp>::_M_type>::
+ _Array_init_ctor<_Tp, __is_fundamental<_Tp>::__value>::
_S_do_it(__b, __e, __t);
}
@@ -171,7 +171,7 @@
const _Tp* __restrict__ __e,
_Tp* __restrict__ __o)
{
- _Array_copy_ctor<_Tp, __is_fundamental<_Tp>::_M_type>::
+ _Array_copy_ctor<_Tp, __is_fundamental<_Tp>::__value>::
_S_do_it(__b, __e, __o);
}
@@ -181,7 +181,7 @@
__valarray_copy_construct (const _Tp* __restrict__ __a, size_t __n,
size_t __s, _Tp* __restrict__ __o)
{
- if (__is_fundamental<_Tp>::_M_type)
+ if (__is_fundamental<_Tp>::__value)
while (__n--)
{
*__o++ = *__a;
@@ -202,7 +202,7 @@
const size_t* __restrict__ __i,
_Tp* __restrict__ __o, size_t __n)
{
- if (__is_fundamental<_Tp>::_M_type)
+ if (__is_fundamental<_Tp>::__value)
while (__n--)
*__o++ = __a[*__i++];
else
@@ -215,7 +215,7 @@
inline void
__valarray_destroy_elements(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
{
- if (!__is_fundamental<_Tp>::_M_type)
+ if (!__is_fundamental<_Tp>::__value)
while (__b != __e)
{
__b->~_Tp();
@@ -279,7 +279,7 @@
__valarray_copy(const _Tp* __restrict__ __a, size_t __n,
_Tp* __restrict__ __b)
{
- _Array_copier<_Tp, __is_fundamental<_Tp>::_M_type>::
+ _Array_copier<_Tp, __is_fundamental<_Tp>::__value>::
_S_do_it(__a, __n, __b);
}
diff -urN libstdc++-v3-orig/include/c_std/std_cmath.h libstdc++-v3/include/c_std/std_cmath.h
--- libstdc++-v3-orig/include/c_std/std_cmath.h 2005-01-16 10:59:06.000000000 +0100
+++ libstdc++-v3/include/c_std/std_cmath.h 2005-02-01 14:03:14.000000000 +0100
@@ -107,7 +107,7 @@
{ return __builtin_acosl(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
acos(_Tp __x)
{
return __builtin_acos(__x);
@@ -124,7 +124,7 @@
{ return __builtin_asinl(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
asin(_Tp __x)
{ return __builtin_asin(__x); }
@@ -139,7 +139,7 @@
{ return __builtin_atanl(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
atan(_Tp __x)
{ return __builtin_atan(__x); }
@@ -154,8 +154,8 @@
{ return __builtin_atan2l(__y, __x); }
template<typename _Tp, typename _Up>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type
- && __is_integer<_Up>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value
+ && __is_integer<_Up>::__value>::__type
atan2(_Tp __y, _Up __x)
{ return __builtin_atan2(__y, __x); }
@@ -170,7 +170,7 @@
{ return __builtin_ceill(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
ceil(_Tp __x)
{ return __builtin_ceil(__x); }
@@ -185,7 +185,7 @@
{ return __builtin_cosl(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
cos(_Tp __x)
{ return __builtin_cos(__x); }
@@ -200,7 +200,7 @@
{ return __builtin_coshl(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
cosh(_Tp __x)
{ return __builtin_cosh(__x); }
@@ -215,7 +215,7 @@
{ return __builtin_expl(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
exp(_Tp __x)
{ return __builtin_exp(__x); }
@@ -230,7 +230,7 @@
{ return __builtin_fabsl(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
fabs(_Tp __x)
{ return __builtin_fabs(__x); }
@@ -245,7 +245,7 @@
{ return __builtin_floorl(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
floor(_Tp __x)
{ return __builtin_floor(__x); }
@@ -270,7 +270,7 @@
{ return __builtin_frexpl(__x, __exp); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
frexp(_Tp __x, int* __exp)
{ return __builtin_frexp(__x, __exp); }
@@ -285,7 +285,7 @@
{ return __builtin_ldexpl(__x, __exp); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
ldexp(_Tp __x, int __exp)
{ return __builtin_ldexp(__x, __exp); }
@@ -300,7 +300,7 @@
{ return __builtin_logl(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
log(_Tp __x)
{ return __builtin_log(__x); }
@@ -315,7 +315,7 @@
{ return __builtin_log10l(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
log10(_Tp __x)
{ return __builtin_log10(__x); }
@@ -371,7 +371,7 @@
{ return __builtin_sinl(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
sin(_Tp __x)
{ return __builtin_sin(__x); }
@@ -386,7 +386,7 @@
{ return __builtin_sinhl(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
sinh(_Tp __x)
{ return __builtin_sinh(__x); }
@@ -401,7 +401,7 @@
{ return __builtin_sqrtl(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
sqrt(_Tp __x)
{ return __builtin_sqrt(__x); }
@@ -416,7 +416,7 @@
{ return __builtin_tanl(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
tan(_Tp __x)
{ return __builtin_tan(__x); }
@@ -431,7 +431,7 @@
{ return __builtin_tanhl(__x); }
template<typename _Tp>
- inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
+ inline typename __enable_if<double, __is_integer<_Tp>::__value>::__type
tanh(_Tp __x)
{ return __builtin_tanh(__x); }
}
diff -urN libstdc++-v3-orig/include/debug/safe_iterator.h libstdc++-v3/include/debug/safe_iterator.h
--- libstdc++-v3-orig/include/debug/safe_iterator.h 2004-05-18 05:27:55.000000000 +0200
+++ libstdc++-v3/include/debug/safe_iterator.h 2005-02-01 14:05:02.000000000 +0100
@@ -1,6 +1,6 @@
// Safe iterator implementation -*- C++ -*-
-// Copyright (C) 2003, 2004
+// Copyright (C) 2003, 2004, 2005
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -139,8 +139,8 @@
typename std::__enable_if<
_Sequence,
(std::__are_same<_MutableIterator,
- typename _Sequence::iterator::_Base_iterator>::_M_type)
- >::_M_type>& __x)
+ typename _Sequence::iterator::_Base_iterator>::__value)
+ >::__type>& __x)
: _Safe_iterator_base(__x, _M_constant()), _M_current(__x.base())
{
_GLIBCXX_DEBUG_VERIFY(!__x._M_singular(),
diff -urN libstdc++-v3-orig/include/std/std_complex.h libstdc++-v3/include/std/std_complex.h
--- libstdc++-v3-orig/include/std/std_complex.h 2005-01-26 11:34:52.000000000 +0100
+++ libstdc++-v3/include/std/std_complex.h 2005-02-01 14:04:11.000000000 +0100
@@ -640,7 +640,7 @@
inline _Tp
norm(const complex<_Tp>& __z)
{
- return _Norm_helper<__is_floating<_Tp>::_M_type
+ return _Norm_helper<__is_floating<_Tp>::__value
&& !_GLIBCXX_FAST_MATH>::_S_do_it(__z);
}