|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r74191 - in trunk/boost/unordered: . detail
From: dnljms_at_[hidden]
Date: 2011-09-02 04:27:30
Author: danieljames
Date: 2011-09-02 04:27:27 EDT (Fri, 02 Sep 2011)
New Revision: 74191
URL: http://svn.boost.org/trac/boost/changeset/74191
Log:
Unordered: Remove pair cast.
Text files modified:
trunk/boost/unordered/detail/util.hpp | 16 ----------------
trunk/boost/unordered/unordered_map.hpp | 29 +++++++++--------------------
trunk/boost/unordered/unordered_set.hpp | 23 +++++++----------------
3 files changed, 16 insertions(+), 52 deletions(-)
Modified: trunk/boost/unordered/detail/util.hpp
==============================================================================
--- trunk/boost/unordered/detail/util.hpp (original)
+++ trunk/boost/unordered/detail/util.hpp 2011-09-02 04:27:27 EDT (Fri, 02 Sep 2011)
@@ -205,22 +205,6 @@
}
////////////////////////////////////////////////////////////////////////////
- // 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
#if !defined(BOOST_NO_STD_DISTANCE)
Modified: trunk/boost/unordered/unordered_map.hpp
==============================================================================
--- trunk/boost/unordered/unordered_map.hpp (original)
+++ trunk/boost/unordered/unordered_map.hpp 2011-09-02 04:27:27 EDT (Fri, 02 Sep 2011)
@@ -854,8 +854,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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>
Modified: trunk/boost/unordered/unordered_set.hpp
==============================================================================
--- trunk/boost/unordered/unordered_set.hpp (original)
+++ trunk/boost/unordered/unordered_set.hpp 2011-09-02 04:27:27 EDT (Fri, 02 Sep 2011)
@@ -821,8 +821,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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>
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk