diff mbox

[v3] Minor debug/formatter.h clean up

Message ID 4CE50846.3090004@oracle.com
State New
Headers show

Commit Message

Paolo Carlini Nov. 18, 2010, 11:04 a.m. UTC
Hi,

as noticed yesterday with Jon. Tested x86_64-linux check-debug, committed.

Paolo.

//////////////////////////
2010-11-18  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/debug/formatter.h (__truth): Remove, unused.
	(__is_same): Remove, include cpp_type_traits.h instead.
	(_Parameter::_Parameter(const _Safe_iterator<>&, const char*,
	_Is_iterator)): Adjust.
	* include/debug/safe_iterator.h (_Safe_iterator<>::_M_constant):
	Likewise.
diff mbox

Patch

Index: include/debug/formatter.h
===================================================================
--- include/debug/formatter.h	(revision 166897)
+++ include/debug/formatter.h	(working copy)
@@ -31,6 +31,7 @@ 
 #define _GLIBCXX_DEBUG_FORMATTER_H 1
 
 #include <bits/c++config.h>
+#include <bits/cpp_type_traits.h>
 #include <typeinfo>
 
 namespace __gnu_debug
@@ -40,21 +41,6 @@ 
   template<typename _Iterator>
     bool __check_singular(_Iterator&);
 
-  /** Determine if the two types are the same. */
-  template<typename _Type1, typename _Type2>
-    struct __is_same
-    {
-      static const bool value = false;
-    };
-
-  template<typename _Type>
-    struct __is_same<_Type, _Type>
-    {
-      static const bool value = true;
-    };
-
-  template<bool> struct __truth { };
-
   class _Safe_sequence_base;
 
   template<typename _Iterator, typename _Sequence>
@@ -225,9 +211,9 @@ 
 	  _M_variant._M_iterator._M_type = 0;
 #endif
 	  _M_variant._M_iterator._M_constness =
-	    __is_same<_Safe_iterator<_Iterator, _Sequence>,
-	                         typename _Sequence::iterator>::
-	      value? __mutable_iterator : __const_iterator;
+	    std::__are_same<_Safe_iterator<_Iterator, _Sequence>,
+	                    typename _Sequence::iterator>::
+	      __value ? __mutable_iterator : __const_iterator;
 	  _M_variant._M_iterator._M_sequence = __it._M_get_sequence();
 #ifdef __GXX_RTTI
 	  _M_variant._M_iterator._M_seq_type = &typeid(_Sequence);
Index: include/debug/safe_iterator.h
===================================================================
--- include/debug/safe_iterator.h	(revision 166897)
+++ include/debug/safe_iterator.h	(working copy)
@@ -95,7 +95,7 @@ 
       _M_constant() const
       {
 	typedef typename _Sequence::const_iterator const_iterator;
-	return __is_same<const_iterator, _Safe_iterator>::value;
+	return std::__are_same<const_iterator, _Safe_iterator>::__value;
       }
 
       typedef std::iterator_traits<_Iterator> _Traits;