Unordered: Fix unnecessary_copy_tests failures.

[SVN r73894]
This commit is contained in:
Daniel James
2011-08-18 19:29:02 +00:00
parent c001139465
commit 2ecfa0e08c
3 changed files with 58 additions and 19 deletions

View File

@@ -38,6 +38,11 @@ namespace detail {
return v;
}
static key_type const& extract(BOOST_RV_REF(key_type) v)
{
return v;
}
static no_key extract()
{
return no_key();
@@ -86,6 +91,13 @@ namespace detail {
return v;
}
// TODO: Why does this cause errors?
//
//static key_type const& extract(BOOST_RV_REF(key_type) v)
//{
// return v;
//}
template <class Second>
static key_type const& extract(std::pair<key_type, Second> const& v)
{

View File

@@ -242,9 +242,11 @@ namespace boost { namespace unordered { namespace detail {
#else
template <class Arg0>
emplace_return emplace(Arg0 const& arg0)
emplace_return emplace(BOOST_FWD_REF(Arg0) arg0)
{
return emplace_impl(extractor::extract(arg0), arg0);
return emplace_impl(
extractor::extract(boost::forward<Arg0>(arg0)),
boost::forward<Arg0>(arg0));
}
#define BOOST_UNORDERED_INSERT1_IMPL(z, n, _) \