From 44f61e5878eceb707eb04cbcda462d3baaca2a40 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 12 May 2013 14:34:45 +0000 Subject: [PATCH] Add BOOST_NOEXCEPT to unordered container methods. I haven't done the iterators yet. [SVN r84253] --- include/boost/unordered/unordered_map.hpp | 72 +++++++++++------------ include/boost/unordered/unordered_set.hpp | 72 +++++++++++------------ 2 files changed, 72 insertions(+), 72 deletions(-) diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index 33449d9c..682e3544 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -178,53 +178,53 @@ namespace unordered unordered_map& operator=(std::initializer_list); #endif - allocator_type get_allocator() const + allocator_type get_allocator() const BOOST_NOEXCEPT { return table_.node_alloc(); } // size and capacity - bool empty() const + bool empty() const BOOST_NOEXCEPT { return table_.size_ == 0; } - size_type size() const + size_type size() const BOOST_NOEXCEPT { return table_.size_; } - size_type max_size() const; + size_type max_size() const BOOST_NOEXCEPT; // iterators - iterator begin() + iterator begin() BOOST_NOEXCEPT { return table_.begin(); } - const_iterator begin() const + const_iterator begin() const BOOST_NOEXCEPT { return table_.begin(); } - iterator end() + iterator end() BOOST_NOEXCEPT { return iterator(); } - const_iterator end() const + const_iterator end() const BOOST_NOEXCEPT { return const_iterator(); } - const_iterator cbegin() const + const_iterator cbegin() const BOOST_NOEXCEPT { return table_.begin(); } - const_iterator cend() const + const_iterator cend() const BOOST_NOEXCEPT { return const_iterator(); } @@ -449,12 +449,12 @@ namespace unordered // bucket interface - size_type bucket_count() const + size_type bucket_count() const BOOST_NOEXCEPT { return table_.bucket_count_; } - size_type max_bucket_count() const + size_type max_bucket_count() const BOOST_NOEXCEPT { return table_.max_bucket_count(); } @@ -501,13 +501,13 @@ namespace unordered // hash policy - float max_load_factor() const + float max_load_factor() const BOOST_NOEXCEPT { return table_.mlf_; } - float load_factor() const; - void max_load_factor(float); + float load_factor() const BOOST_NOEXCEPT; + void max_load_factor(float) BOOST_NOEXCEPT; void rehash(size_type); void reserve(size_type); @@ -660,53 +660,53 @@ namespace unordered unordered_multimap& operator=(std::initializer_list); #endif - allocator_type get_allocator() const + allocator_type get_allocator() const BOOST_NOEXCEPT { return table_.node_alloc(); } // size and capacity - bool empty() const + bool empty() const BOOST_NOEXCEPT { return table_.size_ == 0; } - size_type size() const + size_type size() const BOOST_NOEXCEPT { return table_.size_; } - size_type max_size() const; + size_type max_size() const BOOST_NOEXCEPT; // iterators - iterator begin() + iterator begin() BOOST_NOEXCEPT { return table_.begin(); } - const_iterator begin() const + const_iterator begin() const BOOST_NOEXCEPT { return table_.begin(); } - iterator end() + iterator end() BOOST_NOEXCEPT { return iterator(); } - const_iterator end() const + const_iterator end() const BOOST_NOEXCEPT { return const_iterator(); } - const_iterator cbegin() const + const_iterator cbegin() const BOOST_NOEXCEPT { return table_.begin(); } - const_iterator cend() const + const_iterator cend() const BOOST_NOEXCEPT { return const_iterator(); } @@ -927,12 +927,12 @@ namespace unordered // bucket interface - size_type bucket_count() const + size_type bucket_count() const BOOST_NOEXCEPT { return table_.bucket_count_; } - size_type max_bucket_count() const + size_type max_bucket_count() const BOOST_NOEXCEPT { return table_.max_bucket_count(); } @@ -979,13 +979,13 @@ namespace unordered // hash policy - float max_load_factor() const + float max_load_factor() const BOOST_NOEXCEPT { return table_.mlf_; } - float load_factor() const; - void max_load_factor(float); + float load_factor() const BOOST_NOEXCEPT; + void max_load_factor(float) BOOST_NOEXCEPT; void rehash(size_type); void reserve(size_type); @@ -1105,7 +1105,7 @@ namespace unordered // size and capacity template - std::size_t unordered_map::max_size() const + std::size_t unordered_map::max_size() const BOOST_NOEXCEPT { return table_.max_size(); } @@ -1274,13 +1274,13 @@ namespace unordered // hash policy template - float unordered_map::load_factor() const + float unordered_map::load_factor() const BOOST_NOEXCEPT { return table_.load_factor(); } template - void unordered_map::max_load_factor(float m) + void unordered_map::max_load_factor(float m) BOOST_NOEXCEPT { table_.max_load_factor(m); } @@ -1438,7 +1438,7 @@ namespace unordered // size and capacity template - std::size_t unordered_multimap::max_size() const + std::size_t unordered_multimap::max_size() const BOOST_NOEXCEPT { return table_.max_size(); } @@ -1586,13 +1586,13 @@ namespace unordered // hash policy template - float unordered_multimap::load_factor() const + float unordered_multimap::load_factor() const BOOST_NOEXCEPT { return table_.load_factor(); } template - void unordered_multimap::max_load_factor(float m) + void unordered_multimap::max_load_factor(float m) BOOST_NOEXCEPT { table_.max_load_factor(m); } diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index 6787a3a3..0ccf1b94 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -176,53 +176,53 @@ namespace unordered unordered_set& operator=(std::initializer_list); #endif - allocator_type get_allocator() const + allocator_type get_allocator() const BOOST_NOEXCEPT { return table_.node_alloc(); } // size and capacity - bool empty() const + bool empty() const BOOST_NOEXCEPT { return table_.size_ == 0; } - size_type size() const + size_type size() const BOOST_NOEXCEPT { return table_.size_; } - size_type max_size() const; + size_type max_size() const BOOST_NOEXCEPT; // iterators - iterator begin() + iterator begin() BOOST_NOEXCEPT { return table_.begin(); } - const_iterator begin() const + const_iterator begin() const BOOST_NOEXCEPT { return table_.begin(); } - iterator end() + iterator end() BOOST_NOEXCEPT { return iterator(); } - const_iterator end() const + const_iterator end() const BOOST_NOEXCEPT { return const_iterator(); } - const_iterator cbegin() const + const_iterator cbegin() const BOOST_NOEXCEPT { return table_.begin(); } - const_iterator cend() const + const_iterator cend() const BOOST_NOEXCEPT { return const_iterator(); } @@ -434,12 +434,12 @@ namespace unordered // bucket interface - size_type bucket_count() const + size_type bucket_count() const BOOST_NOEXCEPT { return table_.bucket_count_; } - size_type max_bucket_count() const + size_type max_bucket_count() const BOOST_NOEXCEPT { return table_.max_bucket_count(); } @@ -486,13 +486,13 @@ namespace unordered // hash policy - float max_load_factor() const + float max_load_factor() const BOOST_NOEXCEPT { return table_.mlf_; } - float load_factor() const; - void max_load_factor(float); + float load_factor() const BOOST_NOEXCEPT; + void max_load_factor(float) BOOST_NOEXCEPT; void rehash(size_type); void reserve(size_type); @@ -644,53 +644,53 @@ namespace unordered unordered_multiset& operator=(std::initializer_list); #endif - allocator_type get_allocator() const + allocator_type get_allocator() const BOOST_NOEXCEPT { return table_.node_alloc(); } // size and capacity - bool empty() const + bool empty() const BOOST_NOEXCEPT { return table_.size_ == 0; } - size_type size() const + size_type size() const BOOST_NOEXCEPT { return table_.size_; } - size_type max_size() const; + size_type max_size() const BOOST_NOEXCEPT; // iterators - iterator begin() + iterator begin() BOOST_NOEXCEPT { return iterator(table_.begin()); } - const_iterator begin() const + const_iterator begin() const BOOST_NOEXCEPT { return const_iterator(table_.begin()); } - iterator end() + iterator end() BOOST_NOEXCEPT { return iterator(); } - const_iterator end() const + const_iterator end() const BOOST_NOEXCEPT { return const_iterator(); } - const_iterator cbegin() const + const_iterator cbegin() const BOOST_NOEXCEPT { return const_iterator(table_.begin()); } - const_iterator cend() const + const_iterator cend() const BOOST_NOEXCEPT { return const_iterator(); } @@ -902,12 +902,12 @@ namespace unordered // bucket interface - size_type bucket_count() const + size_type bucket_count() const BOOST_NOEXCEPT { return table_.bucket_count_; } - size_type max_bucket_count() const + size_type max_bucket_count() const BOOST_NOEXCEPT { return table_.max_bucket_count(); } @@ -954,13 +954,13 @@ namespace unordered // hash policy - float max_load_factor() const + float max_load_factor() const BOOST_NOEXCEPT { return table_.mlf_; } - float load_factor() const; - void max_load_factor(float); + float load_factor() const BOOST_NOEXCEPT; + void max_load_factor(float) BOOST_NOEXCEPT; void rehash(size_type); void reserve(size_type); @@ -1080,7 +1080,7 @@ namespace unordered // size and capacity template - std::size_t unordered_set::max_size() const + std::size_t unordered_set::max_size() const BOOST_NOEXCEPT { return table_.max_size(); } @@ -1200,13 +1200,13 @@ namespace unordered // hash policy template - float unordered_set::load_factor() const + float unordered_set::load_factor() const BOOST_NOEXCEPT { return table_.load_factor(); } template - void unordered_set::max_load_factor(float m) + void unordered_set::max_load_factor(float m) BOOST_NOEXCEPT { table_.max_load_factor(m); } @@ -1364,7 +1364,7 @@ namespace unordered // size and capacity template - std::size_t unordered_multiset::max_size() const + std::size_t unordered_multiset::max_size() const BOOST_NOEXCEPT { return table_.max_size(); } @@ -1484,13 +1484,13 @@ namespace unordered // hash policy template - float unordered_multiset::load_factor() const + float unordered_multiset::load_factor() const BOOST_NOEXCEPT { return table_.load_factor(); } template - void unordered_multiset::max_load_factor(float m) + void unordered_multiset::max_load_factor(float m) BOOST_NOEXCEPT { table_.max_load_factor(m); }