mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-29 19:07:15 +02:00
Unordered: Remove pair cast.
[SVN r74191]
This commit is contained in:
@ -204,22 +204,6 @@ namespace boost { namespace unordered { namespace detail {
|
||||
return *bound;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// pair_cast - because some libraries don't have the full pair constructors.
|
||||
|
||||
#if 0
|
||||
template <class Dst1, class Dst2, class Src1, class Src2>
|
||||
inline std::pair<Dst1, Dst2> pair_cast(std::pair<Src1, Src2> const& x)
|
||||
{
|
||||
return std::pair<Dst1, Dst2>(Dst1(x.first), Dst2(x.second));
|
||||
}
|
||||
|
||||
#define BOOST_UNORDERED_PAIR_CAST(First, Last, Argument) \
|
||||
::boost::unordered::detail::pair_cast<First, Last>(Argument)
|
||||
#else
|
||||
#define BOOST_UNORDERED_PAIR_CAST(First, Last, Argument) \
|
||||
Argument
|
||||
#endif
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// insert_size/initial_size
|
||||
|
||||
|
@ -854,8 +854,7 @@ namespace unordered
|
||||
std::pair<BOOST_DEDUCED_TYPENAME unordered_map<K,T,H,P,A>::iterator, bool>
|
||||
unordered_map<K,T,H,P,A>::emplace(Args&&... args)
|
||||
{
|
||||
return BOOST_UNORDERED_PAIR_CAST(iterator, bool,
|
||||
table_.emplace(std::forward<Args>(args)...));
|
||||
return table_.emplace(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <class K, class T, class H, class P, class A>
|
||||
@ -875,8 +874,7 @@ namespace unordered
|
||||
value_type v
|
||||
)
|
||||
{
|
||||
return BOOST_UNORDERED_PAIR_CAST(iterator, bool,
|
||||
table_.emplace(boost::move(v)));
|
||||
return table_.emplace(boost::move(v));
|
||||
}
|
||||
|
||||
template <class K, class T, class H, class P, class A>
|
||||
@ -901,10 +899,7 @@ namespace unordered
|
||||
unordered_map<K,T,H,P,A>::emplace( \
|
||||
BOOST_UNORDERED_FUNCTION_PARAMS(z, n)) \
|
||||
{ \
|
||||
return \
|
||||
BOOST_UNORDERED_PAIR_CAST(iterator, bool, \
|
||||
table_.emplace( \
|
||||
BOOST_UNORDERED_CALL_PARAMS(z, n))); \
|
||||
return table_.emplace(BOOST_UNORDERED_CALL_PARAMS(z, n)); \
|
||||
} \
|
||||
\
|
||||
template <class K, class T, class H, class P, class A> \
|
||||
@ -932,8 +927,7 @@ namespace unordered
|
||||
std::pair<BOOST_DEDUCED_TYPENAME unordered_map<K,T,H,P,A>::iterator, bool>
|
||||
unordered_map<K,T,H,P,A>::insert(value_type const& obj)
|
||||
{
|
||||
return BOOST_UNORDERED_PAIR_CAST(iterator, bool,
|
||||
table_.emplace(obj));
|
||||
return table_.emplace(obj);
|
||||
}
|
||||
|
||||
template <class K, class T, class H, class P, class A>
|
||||
@ -949,8 +943,7 @@ namespace unordered
|
||||
std::pair<BOOST_DEDUCED_TYPENAME unordered_map<K,T,H,P,A>::iterator, bool>
|
||||
unordered_map<K,T,H,P,A>::insert(BOOST_RV_REF(value_type) obj)
|
||||
{
|
||||
return BOOST_UNORDERED_PAIR_CAST(iterator, bool,
|
||||
table_.emplace(boost::move(obj)));
|
||||
return table_.emplace(boost::move(obj));
|
||||
}
|
||||
|
||||
template <class K, class T, class H, class P, class A>
|
||||
@ -1102,8 +1095,7 @@ namespace unordered
|
||||
BOOST_DEDUCED_TYPENAME unordered_map<K,T,H,P,A>::iterator>
|
||||
unordered_map<K,T,H,P,A>::equal_range(const key_type& k)
|
||||
{
|
||||
return BOOST_UNORDERED_PAIR_CAST(iterator, iterator,
|
||||
table_.equal_range(k));
|
||||
return table_.equal_range(k);
|
||||
}
|
||||
|
||||
template <class K, class T, class H, class P, class A>
|
||||
@ -1112,8 +1104,7 @@ namespace unordered
|
||||
BOOST_DEDUCED_TYPENAME unordered_map<K,T,H,P,A>::const_iterator>
|
||||
unordered_map<K,T,H,P,A>::equal_range(const key_type& k) const
|
||||
{
|
||||
return BOOST_UNORDERED_PAIR_CAST(const_iterator, const_iterator,
|
||||
table_.equal_range(k));
|
||||
return table_.equal_range(k);
|
||||
}
|
||||
|
||||
template <class K, class T, class H, class P, class A>
|
||||
@ -1516,8 +1507,7 @@ namespace unordered
|
||||
BOOST_DEDUCED_TYPENAME unordered_multimap<K,T,H,P,A>::iterator>
|
||||
unordered_multimap<K,T,H,P,A>::equal_range(const key_type& k)
|
||||
{
|
||||
return BOOST_UNORDERED_PAIR_CAST(iterator, iterator,
|
||||
table_.equal_range(k));
|
||||
return table_.equal_range(k);
|
||||
}
|
||||
|
||||
template <class K, class T, class H, class P, class A>
|
||||
@ -1526,8 +1516,7 @@ namespace unordered
|
||||
BOOST_DEDUCED_TYPENAME unordered_multimap<K,T,H,P,A>::const_iterator>
|
||||
unordered_multimap<K,T,H,P,A>::equal_range(const key_type& k) const
|
||||
{
|
||||
return BOOST_UNORDERED_PAIR_CAST(const_iterator, const_iterator,
|
||||
table_.equal_range(k));
|
||||
return table_.equal_range(k);
|
||||
}
|
||||
|
||||
template <class K, class T, class H, class P, class A>
|
||||
|
@ -821,8 +821,7 @@ namespace unordered
|
||||
std::pair<BOOST_DEDUCED_TYPENAME unordered_set<T,H,P,A>::iterator, bool>
|
||||
unordered_set<T,H,P,A>::emplace(Args&&... args)
|
||||
{
|
||||
return BOOST_UNORDERED_PAIR_CAST(iterator, bool,
|
||||
table_.emplace(std::forward<Args>(args)...));
|
||||
return table_.emplace(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <class T, class H, class P, class A>
|
||||
@ -841,8 +840,7 @@ namespace unordered
|
||||
value_type v
|
||||
)
|
||||
{
|
||||
return BOOST_UNORDERED_PAIR_CAST(iterator, bool,
|
||||
table_.emplace(boost::move(v)));
|
||||
return table_.emplace(boost::move(v));
|
||||
}
|
||||
|
||||
template <class T, class H, class P, class A>
|
||||
@ -866,10 +864,7 @@ namespace unordered
|
||||
unordered_set<T,H,P,A>::emplace( \
|
||||
BOOST_UNORDERED_FUNCTION_PARAMS(z, n)) \
|
||||
{ \
|
||||
return \
|
||||
BOOST_UNORDERED_PAIR_CAST(iterator, bool, \
|
||||
table_.emplace( \
|
||||
BOOST_UNORDERED_CALL_PARAMS(z, n))); \
|
||||
return table_.emplace(BOOST_UNORDERED_CALL_PARAMS(z, n)); \
|
||||
} \
|
||||
\
|
||||
template <class T, class H, class P, class A> \
|
||||
@ -897,8 +892,7 @@ namespace unordered
|
||||
std::pair<BOOST_DEDUCED_TYPENAME unordered_set<T,H,P,A>::iterator, bool>
|
||||
unordered_set<T,H,P,A>::insert(value_type const& obj)
|
||||
{
|
||||
return BOOST_UNORDERED_PAIR_CAST(iterator, bool,
|
||||
table_.emplace(obj));
|
||||
return table_.emplace(obj);
|
||||
}
|
||||
|
||||
template <class T, class H, class P, class A>
|
||||
@ -914,8 +908,7 @@ namespace unordered
|
||||
std::pair<BOOST_DEDUCED_TYPENAME unordered_set<T,H,P,A>::iterator, bool>
|
||||
unordered_set<T,H,P,A>::insert(BOOST_RV_REF(value_type) obj)
|
||||
{
|
||||
return BOOST_UNORDERED_PAIR_CAST(iterator, bool,
|
||||
table_.emplace(boost::move(obj)));
|
||||
return table_.emplace(boost::move(obj));
|
||||
}
|
||||
|
||||
template <class T, class H, class P, class A>
|
||||
@ -1025,8 +1018,7 @@ namespace unordered
|
||||
BOOST_DEDUCED_TYPENAME unordered_set<T,H,P,A>::const_iterator>
|
||||
unordered_set<T,H,P,A>::equal_range(const key_type& k) const
|
||||
{
|
||||
return BOOST_UNORDERED_PAIR_CAST(const_iterator, const_iterator,
|
||||
table_.equal_range(k));
|
||||
return table_.equal_range(k);
|
||||
}
|
||||
|
||||
template <class T, class H, class P, class A>
|
||||
@ -1406,8 +1398,7 @@ namespace unordered
|
||||
BOOST_DEDUCED_TYPENAME unordered_multiset<T,H,P,A>::const_iterator>
|
||||
unordered_multiset<T,H,P,A>::equal_range(const key_type& k) const
|
||||
{
|
||||
return BOOST_UNORDERED_PAIR_CAST(const_iterator, const_iterator,
|
||||
table_.equal_range(k));
|
||||
return table_.equal_range(k);
|
||||
}
|
||||
|
||||
template <class T, class H, class P, class A>
|
||||
|
Reference in New Issue
Block a user