Add noexcept specifications

This commit is contained in:
Glen Fernandes
2014-05-19 17:39:39 -07:00
parent a3ea40d932
commit 18eb52ecee
2 changed files with 23 additions and 19 deletions

View File

@@ -207,17 +207,17 @@ public:
bool <a href="#any">any</a>() const;
bool <a href="#none">none</a>() const;
dynamic_bitset <a href="#op-not">operator~</a>() const;
size_type <a href="#count">count</a>() const;
size_type <a href="#count">count</a>() const noexcept;
reference <a href="#bracket">operator[]</a>(size_type pos);
bool <a href="#const-bracket">operator[]</a>(size_type pos) const;
unsigned long <a href="#to_ulong">to_ulong</a>() const;
size_type <a href="#size">size</a>() const;
size_type <a href="#num_blocks">num_blocks</a>() const;
size_type <a href="#max_size">max_size</a>() const;
bool <a href="#empty">empty</a>() const;
size_type <a href="#size">size</a>() const noexcept;
size_type <a href="#num_blocks">num_blocks</a>() const noexcept;
size_type <a href="#max_size">max_size</a>() const noexcept;
bool <a href="#empty">empty</a>() const noexcept;
bool <a href="#is_subset_of">is_subset_of</a>(const dynamic_bitset&amp; a) const;
bool <a href="#is_proper_subset_of">is_proper_subset_of</a>(const dynamic_bitset&amp; a) const;
@@ -1572,6 +1572,7 @@ exception guarantee.
<li>Support for C++11 move constructors.</li>
<li>Warning fixes on MSVC 2013.</li>
<li>Support for C++11 minimal allocators.</li>
<li>Add noexcept specifications.</li>
</ul>
<h4><i>Changes in Boost 1.37.0</i></h4>

View File

@@ -4,6 +4,9 @@
// Copyright (c) 2003-2006, 2008 Gennaro Prota
// Copyright (c) 2014 Ahmed Charles
//
// Copyright (c) 2014 Glen Joseph Fernandes
// glenfe at live dot com
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@@ -286,7 +289,7 @@ public:
bool any() const;
bool none() const;
dynamic_bitset operator~() const;
size_type count() const;
size_type count() const BOOST_NOEXCEPT;
// subscript
reference operator[](size_type pos) {
@@ -296,10 +299,10 @@ public:
unsigned long to_ulong() const;
size_type size() const;
size_type num_blocks() const;
size_type max_size() const;
bool empty() const;
size_type size() const BOOST_NOEXCEPT;
size_type num_blocks() const BOOST_NOEXCEPT;
size_type max_size() const BOOST_NOEXCEPT;
bool empty() const BOOST_NOEXCEPT;
bool is_subset_of(const dynamic_bitset& a) const;
bool is_proper_subset_of(const dynamic_bitset& a) const;
@@ -349,10 +352,10 @@ private:
size_type m_do_find_from(size_type first_block) const;
block_width_type count_extra_bits() const { return bit_index(size()); }
static size_type block_index(size_type pos) { return pos / bits_per_block; }
static block_width_type bit_index(size_type pos) { return static_cast<block_width_type>(pos % bits_per_block); }
static Block bit_mask(size_type pos) { return Block(1) << bit_index(pos); }
block_width_type count_extra_bits() const BOOST_NOEXCEPT { return bit_index(size()); }
static size_type block_index(size_type pos) BOOST_NOEXCEPT { return pos / bits_per_block; }
static block_width_type bit_index(size_type pos) BOOST_NOEXCEPT { return static_cast<block_width_type>(pos % bits_per_block); }
static Block bit_mask(size_type pos) BOOST_NOEXCEPT { return Block(1) << bit_index(pos); }
template <typename CharT, typename Traits, typename Alloc>
void init_from_string(const std::basic_string<CharT, Traits, Alloc>& s,
@@ -1072,7 +1075,7 @@ dynamic_bitset<Block, Allocator>::operator~() const
template <typename Block, typename Allocator>
typename dynamic_bitset<Block, Allocator>::size_type
dynamic_bitset<Block, Allocator>::count() const
dynamic_bitset<Block, Allocator>::count() const BOOST_NOEXCEPT
{
using detail::dynamic_bitset_impl::table_width;
using detail::dynamic_bitset_impl::access_by_bytes;
@@ -1206,21 +1209,21 @@ to_ulong() const
template <typename Block, typename Allocator>
inline typename dynamic_bitset<Block, Allocator>::size_type
dynamic_bitset<Block, Allocator>::size() const
dynamic_bitset<Block, Allocator>::size() const BOOST_NOEXCEPT
{
return m_num_bits;
}
template <typename Block, typename Allocator>
inline typename dynamic_bitset<Block, Allocator>::size_type
dynamic_bitset<Block, Allocator>::num_blocks() const
dynamic_bitset<Block, Allocator>::num_blocks() const BOOST_NOEXCEPT
{
return m_bits.size();
}
template <typename Block, typename Allocator>
inline typename dynamic_bitset<Block, Allocator>::size_type
dynamic_bitset<Block, Allocator>::max_size() const
dynamic_bitset<Block, Allocator>::max_size() const BOOST_NOEXCEPT
{
// Semantics of vector<>::max_size() aren't very clear
// (see lib issue 197) and many library implementations
@@ -1241,7 +1244,7 @@ dynamic_bitset<Block, Allocator>::max_size() const
}
template <typename Block, typename Allocator>
inline bool dynamic_bitset<Block, Allocator>::empty() const
inline bool dynamic_bitset<Block, Allocator>::empty() const BOOST_NOEXCEPT
{
return size() == 0;
}