Patchwork [v3] Small clean up to std::bitset

login
register
mail settings
Submitter Paolo Carlini
Date Dec. 9, 2010, 2:33 a.m.
Message ID <4D003FDD.3040206@oracle.com>
Download mbox | patch
Permalink /patch/74824/
State New
Headers show

Comments

Paolo Carlini - Dec. 9, 2010, 2:33 a.m.
Hi,

now that Jason kindly fixed c++/46348, I can commit the below, tested
x86_64-linux.

Paolo.

//////////////////////
2010-12-08  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/bitset (_Base_bitset<>::_Base_bitset(),
	_Base_bitset(unsigned long)): Simplify.

Patch

Index: include/std/bitset
===================================================================
--- include/std/bitset	(revision 166384)
+++ include/std/bitset	(working copy)
@@ -72,9 +72,10 @@ 
       /// 0 is the least significant word.
       _WordT 		_M_w[_Nw];
 
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
-      constexpr _Base_bitset() : _M_w({ }) { }
+      _GLIBCXX_CONSTEXPR _Base_bitset()
+      : _M_w() { }
 
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
       constexpr _Base_bitset(unsigned long long __val)
       : _M_w({ _WordT(__val)
 #if __SIZEOF_LONG_LONG__ > __SIZEOF_LONG__
@@ -82,14 +83,9 @@ 
 #endif
        }) { }
 #else
-      _Base_bitset()
-      { _M_do_reset(); }
-
       _Base_bitset(unsigned long __val)
-      {
-	_M_do_reset();
-	_M_w[0] = __val;
-      }
+      : _M_w()
+      { _M_w[0] = __val; }
 #endif
 
       static _GLIBCXX_CONSTEXPR size_t