Commit ff89096a by Paolo Carlini Committed by Paolo Carlini

cpp_type_traits.h: Move the additions to namespace __gnu_internal outside of namespace std...

2004-06-28  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/cpp_type_traits.h: Move the additions to
	namespace __gnu_internal outside of namespace std; trivial
	formatting fixes.

From-SVN: r83806
parent 4723805a
2004-06-28 Paolo Carlini <pcarlini@suse.de>
* include/bits/cpp_type_traits.h: Move the additions to
namespace __gnu_internal outside of namespace std; trivial
formatting fixes.
2004-06-28 Benjamin Kosnik <bkoz@redhat.com> 2004-06-28 Benjamin Kosnik <bkoz@redhat.com>
* include/debug/safe_base.h (__gnu_debug::_Safe_sequence_base): * include/debug/safe_base.h (__gnu_debug::_Safe_sequence_base):
......
// 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 Free Software Foundation, Inc. // Copyright (C) 2000, 2001, 2002, 2003, 2004 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
...@@ -64,6 +64,19 @@ ...@@ -64,6 +64,19 @@
// -- Gaby (dosreis@cmla.ens-cachan.fr) 2000-03-06. // -- Gaby (dosreis@cmla.ens-cachan.fr) 2000-03-06.
// //
// NB: g++ can not compile these if declared within the class
// __is_pod itself.
namespace __gnu_internal
{
typedef char __one;
typedef char __two[2];
template <typename _Tp>
__one __test_type (int _Tp::*);
template <typename _Tp>
__two& __test_type (...);
} // namespace __gnu_internal
namespace std namespace std
{ {
// Compare for equality of types. // Compare for equality of types.
...@@ -317,31 +330,16 @@ namespace std ...@@ -317,31 +330,16 @@ namespace std
// //
// For the immediate use, the following is a good approximation // For the immediate use, the following is a good approximation
// //
// NB: g++ can not compile these if declared within the class
// __is_pod itself.
namespace __gnu_internal
{
typedef char __one;
typedef char __two[2];
template <typename _Tp>
__one __test_type (int _Tp::*);
template <typename _Tp>
__two& __test_type (...);
}
template<typename _Tp> template<typename _Tp>
struct __is_pod struct __is_pod
{ {
enum enum
{ {
_M_type = (sizeof(__gnu_internal::__test_type<_Tp>(0)) != sizeof(__gnu_internal::__one)) _M_type = (sizeof(__gnu_internal::__test_type<_Tp>(0))
!= sizeof(__gnu_internal::__one))
}; };
}; };
} // namespace std } // namespace std
#endif //_CPP_TYPE_TRAITS_H #endif //_CPP_TYPE_TRAITS_H
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