aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/tr2
diff options
context:
space:
mode:
authorEdward Smith-Rowland <3dw4rd@verizon.net>2012-06-26 00:14:00 +0000
committerEdward Smith-Rowland <3dw4rd@verizon.net>2012-06-26 00:14:00 +0000
commit8b93933de4087681b2c1809d29ce16f0f40d5951 (patch)
tree41f573118fced76d5a63129158358ebbb455ddf4 /libstdc++-v3/include/tr2
parentda5b360036be98b0f7caccfdfa04ffbddfa9e6e2 (diff)
Add C++11 isms to tr2/dynamic_bitset and tr2/bool_set.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@188967 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/tr2')
-rw-r--r--libstdc++-v3/include/tr2/bool_set6
-rw-r--r--libstdc++-v3/include/tr2/dynamic_bitset25
2 files changed, 16 insertions, 15 deletions
diff --git a/libstdc++-v3/include/tr2/bool_set b/libstdc++-v3/include/tr2/bool_set
index f577ed0c76c..61fd1c83e96 100644
--- a/libstdc++-v3/include/tr2/bool_set
+++ b/libstdc++-v3/include/tr2/bool_set
@@ -1,6 +1,6 @@
// TR2 <bool_set> -*- C++ -*-
-// Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2011, 2012 Free Software Foundation, Inc.
//
// 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
@@ -56,10 +56,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
public:
/// Default constructor.
- bool_set() : _M_b(_S_false) { }
+ constexpr bool_set() : _M_b(_S_false) { }
/// Constructor from bool.
- bool_set(bool __t) : _M_b(_Bool_set_val(__t)) { }
+ constexpr bool_set(bool __t) : _M_b(_Bool_set_val(__t)) { }
// I'm not sure about this.
bool contains(bool_set __b) const
diff --git a/libstdc++-v3/include/tr2/dynamic_bitset b/libstdc++-v3/include/tr2/dynamic_bitset
index 4c06b84c2a5..5ca56470bd2 100644
--- a/libstdc++-v3/include/tr2/dynamic_bitset
+++ b/libstdc++-v3/include/tr2/dynamic_bitset
@@ -1,6 +1,6 @@
// TR2 <dynamic_bitset> -*- C++ -*-
-// Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
//
// 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
@@ -146,19 +146,19 @@ public:
{ return this->_M_w.get_allocator(); }
static size_type
- _S_whichword(size_type __pos)
+ _S_whichword(size_type __pos) noexcept
{ return __pos / _S_bits_per_block; }
static size_type
- _S_whichbyte(size_type __pos)
+ _S_whichbyte(size_type __pos) noexcept
{ return (__pos % _S_bits_per_block) / __CHAR_BIT__; }
static size_type
- _S_whichbit(size_type __pos)
+ _S_whichbit(size_type __pos) noexcept
{ return __pos % _S_bits_per_block; }
static block_type
- _S_maskbit(size_type __pos)
+ _S_maskbit(size_type __pos) noexcept
{ return (static_cast<block_type>(1)) << _S_whichbit(__pos); }
block_type&
@@ -333,7 +333,7 @@ public:
}
size_type
- _M_size() const
+ _M_size() const noexcept
{ return this->_M_w.size(); }
unsigned long
@@ -1141,28 +1141,29 @@ public:
/// Returns the number of bits which are set.
size_type
- count() const
+ count() const noexcept
{ return this->_M_do_count(); }
/// Returns the total number of bits.
size_type
- size() const
+ size() const noexcept
{ return this->_M_Nb; }
/// Returns the total number of blocks.
- size_type num_blocks() const
+ size_type
+ num_blocks() const noexcept
{ return this->_M_size(); }
/// Returns true if the dynamic_bitset is empty.
bool
- empty() const
+ empty() const noexcept
{ return (this->_M_Nb == 0); }
/// Returns the maximum size of a dynamic_bitset object having the same
/// type as *this.
/// The real answer is max() * bits_per_block but is likely to overflow.
- /*constexpr*/ size_type
- max_size() const
+ constexpr size_type
+ max_size() noexcept
{ return std::numeric_limits<block_type>::max(); }
/**