#ifndef BOOST_UNORDERED_UNORDERED_MAP_HPP_INCLUDED
#define BOOST_UNORDERED_UNORDERED_MAP_HPP_INCLUDED
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
+#include <boost/config.hpp>
+#if defined(BOOST_HAS_PRAGMA_ONCE)
+#pragma once
#endif
#include <boost/unordered/unordered_map_fwd.hpp>
private:
typedef boost::unordered::detail::map<A, K, T, H, P> types;
- typedef typename types::allocator value_allocator;
typedef typename types::traits allocator_traits;
typedef typename types::table table;
#if defined(BOOST_UNORDERED_USE_MOVE)
unordered_map(BOOST_RV_REF(unordered_map) other)
+ BOOST_NOEXCEPT_IF(table::nothrow_move_constructible)
: table_(other.table_, boost::unordered::detail::move_tag())
{
}
-#elif !defined(BOOST_NO_RVALUE_REFERENCES)
+#elif !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
unordered_map(unordered_map&& other)
+ BOOST_NOEXCEPT_IF(table::nothrow_move_constructible)
: table_(other.table_, boost::unordered::detail::move_tag())
{
}
#endif
-#if !defined(BOOST_NO_RVALUE_REFERENCES)
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
unordered_map(unordered_map&&, allocator_type const&);
#endif
// Destructor
- ~unordered_map();
+ ~unordered_map() BOOST_NOEXCEPT;
// Assign
return *this;
}
-#if !defined(BOOST_NO_RVALUE_REFERENCES)
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
unordered_map& operator=(unordered_map&& x)
{
table_.move_assign(x.table_);
unordered_map& operator=(std::initializer_list<value_type>);
#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();
}
// emplace
-#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template <class... Args>
std::pair<iterator, bool> emplace(BOOST_FWD_REF(Args)... args)
{
// 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();
}
size_type bucket(const key_type& k) const
{
- return table::to_bucket(table_.bucket_count_,
- table_.hash(k));
+ return table_.hash_to_bucket(table_.hash(k));
}
local_iterator begin(size_type n)
{
- return table_.size_ ? local_iterator(
- table_.get_start(n), n, table_.bucket_count_) :
- local_iterator();
+ return local_iterator(
+ table_.begin(n), n, table_.bucket_count_);
}
const_local_iterator begin(size_type n) const
{
- return table_.size_ ? const_local_iterator(
- table_.get_start(n), n, table_.bucket_count_) :
- const_local_iterator();
+ return const_local_iterator(
+ table_.begin(n), n, table_.bucket_count_);
}
local_iterator end(size_type)
const_local_iterator cbegin(size_type n) const
{
- return table_.size_ ? const_local_iterator(
- table_.get_start(n), n, table_.bucket_count_) :
- const_local_iterator();
+ return const_local_iterator(
+ table_.begin(n), n, table_.bucket_count_);
}
const_local_iterator cend(size_type) const
// 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);
private:
typedef boost::unordered::detail::multimap<A, K, T, H, P> types;
- typedef typename types::allocator value_allocator;
typedef typename types::traits allocator_traits;
typedef typename types::table table;
#if defined(BOOST_UNORDERED_USE_MOVE)
unordered_multimap(BOOST_RV_REF(unordered_multimap) other)
+ BOOST_NOEXCEPT_IF(table::nothrow_move_constructible)
: table_(other.table_, boost::unordered::detail::move_tag())
{
}
-#elif !defined(BOOST_NO_RVALUE_REFERENCES)
+#elif !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
unordered_multimap(unordered_multimap&& other)
+ BOOST_NOEXCEPT_IF(table::nothrow_move_constructible)
: table_(other.table_, boost::unordered::detail::move_tag())
{
}
#endif
-#if !defined(BOOST_NO_RVALUE_REFERENCES)
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
unordered_multimap(unordered_multimap&&, allocator_type const&);
#endif
// Destructor
- ~unordered_multimap();
+ ~unordered_multimap() BOOST_NOEXCEPT;
// Assign
return *this;
}
-#if !defined(BOOST_NO_RVALUE_REFERENCES)
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
unordered_multimap& operator=(unordered_multimap&& x)
{
table_.move_assign(x.table_);
unordered_multimap& operator=(std::initializer_list<value_type>);
#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();
}
// emplace
-#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template <class... Args>
iterator emplace(BOOST_FWD_REF(Args)... args)
{
// 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();
}
size_type bucket(const key_type& k) const
{
- return table::to_bucket(table_.bucket_count_,
- table_.hash(k));
+ return table_.hash_to_bucket(table_.hash(k));
}
local_iterator begin(size_type n)
{
- return table_.size_ ? local_iterator(
- table_.get_start(n), n, table_.bucket_count_) :
- local_iterator();
+ return local_iterator(
+ table_.begin(n), n, table_.bucket_count_);
}
const_local_iterator begin(size_type n) const
{
- return table_.size_ ? const_local_iterator(
- table_.get_start(n), n, table_.bucket_count_) :
- const_local_iterator();
+ return const_local_iterator(
+ table_.begin(n), n, table_.bucket_count_);
}
local_iterator end(size_type)
const_local_iterator cbegin(size_type n) const
{
- return table_.size_ ? const_local_iterator(
- table_.get_start(n), n, table_.bucket_count_) :
- const_local_iterator();
+ return const_local_iterator(
+ table_.begin(n), n, table_.bucket_count_);
}
const_local_iterator cend(size_type) const
// 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);
}
template <class K, class T, class H, class P, class A>
- unordered_map<K,T,H,P,A>::~unordered_map() {}
+ unordered_map<K,T,H,P,A>::~unordered_map() BOOST_NOEXCEPT {}
template <class K, class T, class H, class P, class A>
unordered_map<K,T,H,P,A>::unordered_map(
{
}
-#if !defined(BOOST_NO_RVALUE_REFERENCES)
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <class K, class T, class H, class P, class A>
unordered_map<K,T,H,P,A>::unordered_map(
// size and capacity
template <class K, class T, class H, class P, class A>
- std::size_t unordered_map<K,T,H,P,A>::max_size() const
+ std::size_t unordered_map<K,T,H,P,A>::max_size() const BOOST_NOEXCEPT
{
return table_.max_size();
}
// hash policy
template <class K, class T, class H, class P, class A>
- float unordered_map<K,T,H,P,A>::load_factor() const
+ float unordered_map<K,T,H,P,A>::load_factor() const BOOST_NOEXCEPT
{
return table_.load_factor();
}
template <class K, class T, class H, class P, class A>
- void unordered_map<K,T,H,P,A>::max_load_factor(float m)
+ void unordered_map<K,T,H,P,A>::max_load_factor(float m) BOOST_NOEXCEPT
{
table_.max_load_factor(m);
}
}
template <class K, class T, class H, class P, class A>
- unordered_multimap<K,T,H,P,A>::~unordered_multimap() {}
+ unordered_multimap<K,T,H,P,A>::~unordered_multimap() BOOST_NOEXCEPT {}
template <class K, class T, class H, class P, class A>
unordered_multimap<K,T,H,P,A>::unordered_multimap(
{
}
-#if !defined(BOOST_NO_RVALUE_REFERENCES)
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
template <class K, class T, class H, class P, class A>
unordered_multimap<K,T,H,P,A>::unordered_multimap(
// size and capacity
template <class K, class T, class H, class P, class A>
- std::size_t unordered_multimap<K,T,H,P,A>::max_size() const
+ std::size_t unordered_multimap<K,T,H,P,A>::max_size() const BOOST_NOEXCEPT
{
return table_.max_size();
}
// hash policy
template <class K, class T, class H, class P, class A>
- float unordered_multimap<K,T,H,P,A>::load_factor() const
+ float unordered_multimap<K,T,H,P,A>::load_factor() const BOOST_NOEXCEPT
{
return table_.load_factor();
}
template <class K, class T, class H, class P, class A>
- void unordered_multimap<K,T,H,P,A>::max_load_factor(float m)
+ void unordered_multimap<K,T,H,P,A>::max_load_factor(float m) BOOST_NOEXCEPT
{
table_.max_load_factor(m);
}