type_traits.h: Avoid _T, badname for some targets; also avoid plain T.
2006-10-01 Paolo Carlini <pcarlini@suse.de> * include/ext/type_traits.h: Avoid _T, badname for some targets; also avoid plain T. From-SVN: r117347
This commit is contained in:
parent
bc8b35b594
commit
56f61bfff3
|
@ -1,3 +1,8 @@
|
||||||
|
2006-10-01 Paolo Carlini <pcarlini@suse.de>
|
||||||
|
|
||||||
|
* include/ext/type_traits.h: Avoid _T, badname for some targets;
|
||||||
|
also avoid plain T.
|
||||||
|
|
||||||
2006-10-01 Paolo Carlini <pcarlini@suse.de>
|
2006-10-01 Paolo Carlini <pcarlini@suse.de>
|
||||||
|
|
||||||
* config/io/basic_file_stdio.cc: As an extension, and
|
* config/io/basic_file_stdio.cc: As an extension, and
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
// General Public License for more details.
|
// General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License along
|
||||||
// along with this library; see the file COPYING. If not, write to
|
// with this library; see the file COPYING. If not, write to the Free
|
||||||
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||||
// MA 02111-1307, USA.
|
// USA.
|
||||||
|
|
||||||
// As a special exception, you may use this file as part of a free
|
// As a special exception, you may use this file as part of a free
|
||||||
// software library without restriction. Specifically, if other files
|
// software library without restriction. Specifically, if other files
|
||||||
|
@ -62,11 +62,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||||
|
|
||||||
|
|
||||||
// Given an integral builtin type, return the corresponding unsigned type.
|
// Given an integral builtin type, return the corresponding unsigned type.
|
||||||
template<typename _T>
|
template<typename _Tp>
|
||||||
struct __add_unsigned
|
struct __add_unsigned
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
typedef __enable_if<std::__is_integer<_T>::__value, _T> __if_type;
|
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef typename __if_type::__type __type;
|
typedef typename __if_type::__type __type;
|
||||||
|
@ -105,11 +105,11 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||||
|
|
||||||
|
|
||||||
// Given an integral builtin type, return the corresponding signed type.
|
// Given an integral builtin type, return the corresponding signed type.
|
||||||
template<typename _T>
|
template<typename _Tp>
|
||||||
struct __remove_unsigned
|
struct __remove_unsigned
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
typedef __enable_if<std::__is_integer<_T>::__value, _T> __if_type;
|
typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef typename __if_type::__type __type;
|
typedef typename __if_type::__type __type;
|
||||||
|
@ -149,14 +149,15 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
|
||||||
|
|
||||||
// Compile time constants for builtin types.
|
// Compile time constants for builtin types.
|
||||||
// Sadly std::numeric_limits member functions cannot be used for this.
|
// Sadly std::numeric_limits member functions cannot be used for this.
|
||||||
#define __glibcxx_signed(T) ((T)(-1) < 0)
|
#define __glibcxx_signed(_Tp) ((_Tp)(-1) < 0)
|
||||||
#define __glibcxx_digits(T) (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed(T))
|
#define __glibcxx_digits(_Tp) \
|
||||||
|
(sizeof(_Tp) * __CHAR_BIT__ - __glibcxx_signed(_Tp))
|
||||||
|
|
||||||
#define __glibcxx_min(T) \
|
#define __glibcxx_min(_Tp) \
|
||||||
(__glibcxx_signed(T) ? (T)1 << __glibcxx_digits(T) : (T)0)
|
(__glibcxx_signed(_Tp) ? (_Tp)1 << __glibcxx_digits(_Tp) : (_Tp)0)
|
||||||
|
|
||||||
#define __glibcxx_max(T) \
|
#define __glibcxx_max(_Tp) \
|
||||||
(__glibcxx_signed(T) ? ((T)1 << __glibcxx_digits(T)) - 1 : ~(T)0)
|
(__glibcxx_signed(_Tp) ? ((_Tp)1 << __glibcxx_digits(_Tp)) - 1 : ~(_Tp)0)
|
||||||
|
|
||||||
template<typename _Value>
|
template<typename _Value>
|
||||||
struct __numeric_traits_integer
|
struct __numeric_traits_integer
|
||||||
|
|
Loading…
Reference in New Issue