forked from boostorg/unordered
Format with clang-format 4.0
This commit is contained in:
@@ -356,9 +356,9 @@ namespace boost {
|
||||
}
|
||||
|
||||
template <class I>
|
||||
inline std::size_t initial_size(
|
||||
I i, I j, std::size_t num_buckets =
|
||||
boost::unordered::detail::default_bucket_count)
|
||||
inline std::size_t initial_size(I i, I j,
|
||||
std::size_t num_buckets =
|
||||
boost::unordered::detail::default_bucket_count)
|
||||
{
|
||||
// TODO: Why +1?
|
||||
return (std::max)(
|
||||
@@ -384,6 +384,7 @@ namespace boost {
|
||||
|
||||
T& get() { return value_; }
|
||||
T const& get() const { return value_; }
|
||||
|
||||
private:
|
||||
T value_;
|
||||
};
|
||||
@@ -1027,17 +1028,17 @@ namespace boost {
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
|
||||
template <typename T, typename ValueType, typename... Args>
|
||||
BOOST_UNORDERED_HAS_FUNCTION(
|
||||
construct, U, (boost::unordered::detail::make<ValueType*>(),
|
||||
boost::unordered::detail::make<Args const>()...),
|
||||
BOOST_UNORDERED_HAS_FUNCTION(construct, U,
|
||||
(boost::unordered::detail::make<ValueType*>(),
|
||||
boost::unordered::detail::make<Args const>()...),
|
||||
2);
|
||||
|
||||
#else
|
||||
|
||||
template <typename T, typename ValueType>
|
||||
BOOST_UNORDERED_HAS_FUNCTION(
|
||||
construct, U, (boost::unordered::detail::make<ValueType*>(),
|
||||
boost::unordered::detail::make<ValueType const>()),
|
||||
BOOST_UNORDERED_HAS_FUNCTION(construct, U,
|
||||
(boost::unordered::detail::make<ValueType*>(),
|
||||
boost::unordered::detail::make<ValueType const>()),
|
||||
2);
|
||||
|
||||
#endif
|
||||
@@ -2686,7 +2687,7 @@ namespace boost {
|
||||
{
|
||||
construct(current_, bf.current(),
|
||||
boost::unordered::detail::integral_constant<bool,
|
||||
nothrow_move_constructible>());
|
||||
nothrow_move_constructible>());
|
||||
}
|
||||
|
||||
~functions() { this->destroy(current_); }
|
||||
@@ -3169,9 +3170,10 @@ namespace boost {
|
||||
|
||||
// I think swap can throw if Propagate::value,
|
||||
// since the allocators' swap can throw. Not sure though.
|
||||
swap_allocators(x, boost::unordered::detail::integral_constant<bool,
|
||||
allocator_traits<node_allocator>::
|
||||
propagate_on_container_swap::value>());
|
||||
swap_allocators(
|
||||
x, boost::unordered::detail::integral_constant<bool,
|
||||
allocator_traits<
|
||||
node_allocator>::propagate_on_container_swap::value>());
|
||||
|
||||
boost::swap(buckets_, x.buckets_);
|
||||
boost::swap(bucket_count_, x.bucket_count_);
|
||||
@@ -3294,8 +3296,8 @@ namespace boost {
|
||||
if (this != &x) {
|
||||
assign(x, is_unique,
|
||||
boost::unordered::detail::integral_constant<bool,
|
||||
allocator_traits<node_allocator>::
|
||||
propagate_on_container_copy_assignment::value>());
|
||||
allocator_traits<node_allocator>::
|
||||
propagate_on_container_copy_assignment::value>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3350,8 +3352,8 @@ namespace boost {
|
||||
if (this != &x) {
|
||||
move_assign(x, is_unique,
|
||||
boost::unordered::detail::integral_constant<bool,
|
||||
allocator_traits<node_allocator>::
|
||||
propagate_on_container_move_assignment::value>());
|
||||
allocator_traits<node_allocator>::
|
||||
propagate_on_container_move_assignment::value>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4211,9 +4213,9 @@ namespace boost {
|
||||
}
|
||||
|
||||
template <class I>
|
||||
void insert_range_equiv(
|
||||
I i, I j, typename boost::unordered::detail::disable_if_forward<I,
|
||||
void*>::type = 0)
|
||||
void insert_range_equiv(I i, I j,
|
||||
typename boost::unordered::detail::disable_if_forward<I,
|
||||
void*>::type = 0)
|
||||
{
|
||||
for (; i != j; ++i) {
|
||||
emplace_equiv(boost::unordered::detail::func::construct_node(
|
||||
@@ -4680,8 +4682,9 @@ namespace boost {
|
||||
template <typename A, typename T>
|
||||
struct node : boost::unordered::detail::value_base<T>
|
||||
{
|
||||
typedef typename ::boost::unordered::detail::rebind_wrap<A,
|
||||
node<A, T> >::type allocator;
|
||||
typedef
|
||||
typename ::boost::unordered::detail::rebind_wrap<A, node<A, T> >::type
|
||||
allocator;
|
||||
typedef typename ::boost::unordered::detail::allocator_traits<
|
||||
allocator>::pointer node_pointer;
|
||||
typedef node_pointer link_pointer;
|
||||
|
@@ -19,8 +19,9 @@ namespace boost {
|
||||
typedef P key_equal;
|
||||
typedef K const const_key_type;
|
||||
|
||||
typedef typename ::boost::unordered::detail::rebind_wrap<A,
|
||||
value_type>::type value_allocator;
|
||||
typedef
|
||||
typename ::boost::unordered::detail::rebind_wrap<A, value_type>::type
|
||||
value_allocator;
|
||||
typedef boost::unordered::detail::allocator_traits<value_allocator>
|
||||
value_allocator_traits;
|
||||
|
||||
|
@@ -18,8 +18,9 @@ namespace boost {
|
||||
typedef P key_equal;
|
||||
typedef T const const_key_type;
|
||||
|
||||
typedef typename ::boost::unordered::detail::rebind_wrap<A,
|
||||
value_type>::type value_allocator;
|
||||
typedef
|
||||
typename ::boost::unordered::detail::rebind_wrap<A, value_type>::type
|
||||
value_allocator;
|
||||
typedef boost::unordered::detail::allocator_traits<value_allocator>
|
||||
value_allocator_traits;
|
||||
|
||||
|
@@ -309,7 +309,7 @@ namespace boost {
|
||||
return table_.emplace_hint_unique(hint,
|
||||
table::extractor::extract(boost::forward<A0>(a0)),
|
||||
boost::unordered::detail::create_emplace_args(
|
||||
boost::forward<A0>(a0)));
|
||||
boost::forward<A0>(a0)));
|
||||
}
|
||||
|
||||
template <typename A0, typename A1>
|
||||
@@ -317,19 +317,19 @@ namespace boost {
|
||||
const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
||||
{
|
||||
return table_.emplace_hint_unique(hint,
|
||||
table::extractor::extract(boost::forward<A0>(a0),
|
||||
boost::forward<A1>(a1)),
|
||||
boost::unordered::detail::create_emplace_args(boost::forward<A0>(a0),
|
||||
boost::forward<A1>(a1)));
|
||||
table::extractor::extract(
|
||||
boost::forward<A0>(a0), boost::forward<A1>(a1)),
|
||||
boost::unordered::detail::create_emplace_args(
|
||||
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
||||
}
|
||||
|
||||
template <typename A0, typename A1, typename A2>
|
||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0,
|
||||
BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
||||
{
|
||||
return table_.emplace_hint_unique(
|
||||
hint, table::extractor::extract(
|
||||
boost::forward<A0>(a0), boost::forward<A1>(a1)),
|
||||
return table_.emplace_hint_unique(hint,
|
||||
table::extractor::extract(
|
||||
boost::forward<A0>(a0), boost::forward<A1>(a1)),
|
||||
boost::unordered::detail::create_emplace_args(boost::forward<A0>(a0),
|
||||
boost::forward<A1>(a1), boost::forward<A2>(a2)));
|
||||
}
|
||||
@@ -354,9 +354,9 @@ namespace boost {
|
||||
iterator emplace_hint( \
|
||||
const_iterator hint, BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
|
||||
{ \
|
||||
return table_.emplace_hint_unique( \
|
||||
hint, table::extractor::extract( \
|
||||
boost::forward<A0>(a0), boost::forward<A1>(a1)), \
|
||||
return table_.emplace_hint_unique(hint, \
|
||||
table::extractor::extract( \
|
||||
boost::forward<A0>(a0), boost::forward<A1>(a1)), \
|
||||
boost::unordered::detail::create_emplace_args( \
|
||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \
|
||||
}
|
||||
@@ -532,8 +532,7 @@ namespace boost {
|
||||
std::pair<iterator, bool> try_emplace(key_type const& k,
|
||||
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
||||
{
|
||||
return table_.try_emplace_unique(
|
||||
k,
|
||||
return table_.try_emplace_unique(k,
|
||||
boost::unordered::detail::create_emplace_args(boost::forward<A0>(a0),
|
||||
boost::forward<A1>(a1), boost::forward<A2>(a2)));
|
||||
}
|
||||
@@ -562,8 +561,7 @@ namespace boost {
|
||||
std::pair<iterator, bool> try_emplace(BOOST_RV_REF(key_type) k,
|
||||
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
||||
{
|
||||
return table_.try_emplace_unique(
|
||||
boost::move(k),
|
||||
return table_.try_emplace_unique(boost::move(k),
|
||||
boost::unordered::detail::create_emplace_args(boost::forward<A0>(a0),
|
||||
boost::forward<A1>(a1), boost::forward<A2>(a2)));
|
||||
}
|
||||
@@ -592,8 +590,7 @@ namespace boost {
|
||||
iterator try_emplace(const_iterator hint, key_type const& k,
|
||||
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
||||
{
|
||||
return table_.try_emplace_hint_unique(
|
||||
hint, k,
|
||||
return table_.try_emplace_hint_unique(hint, k,
|
||||
boost::unordered::detail::create_emplace_args(boost::forward<A0>(a0),
|
||||
boost::forward<A1>(a1), boost::forward<A2>(a2)));
|
||||
}
|
||||
@@ -614,16 +611,15 @@ namespace boost {
|
||||
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
||||
{
|
||||
return table_.try_emplace_hint_unique(hint, boost::move(k),
|
||||
boost::unordered::detail::create_emplace_args(boost::forward<A0>(a0),
|
||||
boost::forward<A1>(a1)));
|
||||
boost::unordered::detail::create_emplace_args(
|
||||
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
||||
}
|
||||
|
||||
template <typename A0, typename A1, typename A2>
|
||||
iterator try_emplace(const_iterator hint, BOOST_RV_REF(key_type) k,
|
||||
BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
||||
{
|
||||
return table_.try_emplace_hint_unique(
|
||||
hint, boost::move(k),
|
||||
return table_.try_emplace_hint_unique(hint, boost::move(k),
|
||||
boost::unordered::detail::create_emplace_args(boost::forward<A0>(a0),
|
||||
boost::forward<A1>(a1), boost::forward<A2>(a2)));
|
||||
}
|
||||
@@ -644,8 +640,8 @@ namespace boost {
|
||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
|
||||
{ \
|
||||
return table_.try_emplace_unique(boost::move(k), \
|
||||
boost::unordered::detail::create_emplace_args(BOOST_PP_ENUM_##z( \
|
||||
n, BOOST_UNORDERED_CALL_FORWARD, a))); \
|
||||
boost::unordered::detail::create_emplace_args( \
|
||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \
|
||||
} \
|
||||
\
|
||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename A)> \
|
||||
@@ -662,8 +658,8 @@ namespace boost {
|
||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
|
||||
{ \
|
||||
return table_.try_emplace_hint_unique(hint, boost::move(k), \
|
||||
boost::unordered::detail::create_emplace_args(BOOST_PP_ENUM_##z( \
|
||||
n, BOOST_UNORDERED_CALL_FORWARD, a))); \
|
||||
boost::unordered::detail::create_emplace_args( \
|
||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \
|
||||
}
|
||||
|
||||
BOOST_UNORDERED_TRY_EMPLACE(1, 4, _)
|
||||
@@ -1105,8 +1101,7 @@ namespace boost {
|
||||
template <typename A0>
|
||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0)
|
||||
{
|
||||
return iterator(table_.emplace_hint_equiv(
|
||||
hint,
|
||||
return iterator(table_.emplace_hint_equiv(hint,
|
||||
boost::unordered::detail::func::construct_node_from_args(
|
||||
table_.node_alloc(), boost::unordered::detail::create_emplace_args(
|
||||
boost::forward<A0>(a0)))));
|
||||
|
@@ -307,7 +307,7 @@ namespace boost {
|
||||
return table_.emplace_hint_unique(hint,
|
||||
table::extractor::extract(boost::forward<A0>(a0)),
|
||||
boost::unordered::detail::create_emplace_args(
|
||||
boost::forward<A0>(a0)));
|
||||
boost::forward<A0>(a0)));
|
||||
}
|
||||
|
||||
template <typename A0, typename A1>
|
||||
@@ -315,19 +315,19 @@ namespace boost {
|
||||
const_iterator hint, BOOST_FWD_REF(A0) a0, BOOST_FWD_REF(A1) a1)
|
||||
{
|
||||
return table_.emplace_hint_unique(hint,
|
||||
table::extractor::extract(boost::forward<A0>(a0),
|
||||
boost::forward<A1>(a1)),
|
||||
boost::unordered::detail::create_emplace_args(boost::forward<A0>(a0),
|
||||
boost::forward<A1>(a1)));
|
||||
table::extractor::extract(
|
||||
boost::forward<A0>(a0), boost::forward<A1>(a1)),
|
||||
boost::unordered::detail::create_emplace_args(
|
||||
boost::forward<A0>(a0), boost::forward<A1>(a1)));
|
||||
}
|
||||
|
||||
template <typename A0, typename A1, typename A2>
|
||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0,
|
||||
BOOST_FWD_REF(A1) a1, BOOST_FWD_REF(A2) a2)
|
||||
{
|
||||
return table_.emplace_hint_unique(
|
||||
hint, table::extractor::extract(
|
||||
boost::forward<A0>(a0), boost::forward<A1>(a1)),
|
||||
return table_.emplace_hint_unique(hint,
|
||||
table::extractor::extract(
|
||||
boost::forward<A0>(a0), boost::forward<A1>(a1)),
|
||||
boost::unordered::detail::create_emplace_args(boost::forward<A0>(a0),
|
||||
boost::forward<A1>(a1), boost::forward<A2>(a2)));
|
||||
}
|
||||
@@ -352,9 +352,9 @@ namespace boost {
|
||||
iterator emplace_hint( \
|
||||
const_iterator hint, BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_FWD_PARAM, a)) \
|
||||
{ \
|
||||
return table_.emplace_hint_unique( \
|
||||
hint, table::extractor::extract( \
|
||||
boost::forward<A0>(a0), boost::forward<A1>(a1)), \
|
||||
return table_.emplace_hint_unique(hint, \
|
||||
table::extractor::extract( \
|
||||
boost::forward<A0>(a0), boost::forward<A1>(a1)), \
|
||||
boost::unordered::detail::create_emplace_args( \
|
||||
BOOST_PP_ENUM_##z(n, BOOST_UNORDERED_CALL_FORWARD, a))); \
|
||||
}
|
||||
@@ -813,8 +813,7 @@ namespace boost {
|
||||
template <typename A0>
|
||||
iterator emplace_hint(const_iterator hint, BOOST_FWD_REF(A0) a0)
|
||||
{
|
||||
return iterator(table_.emplace_hint_equiv(
|
||||
hint,
|
||||
return iterator(table_.emplace_hint_equiv(hint,
|
||||
boost::unordered::detail::func::construct_node_from_args(
|
||||
table_.node_alloc(), boost::unordered::detail::create_emplace_args(
|
||||
boost::forward<A0>(a0)))));
|
||||
|
Reference in New Issue
Block a user