mirror of
https://github.com/boostorg/unordered.git
synced 2025-08-01 04:14:29 +02:00
Remove moved_value_from() in favor of overloading move() in container type traits
This commit is contained in:
@@ -1255,7 +1255,7 @@ public:
|
|||||||
* elements' values.
|
* elements' values.
|
||||||
*/
|
*/
|
||||||
x.for_all_elements([this](element_type* p){
|
x.for_all_elements([this](element_type* p){
|
||||||
unchecked_insert(type_policy::moved_value_from(*p));
|
unchecked_insert(type_policy::move(type_policy::value_from(*p)));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1352,7 +1352,7 @@ public:
|
|||||||
* elements' values.
|
* elements' values.
|
||||||
*/
|
*/
|
||||||
x.for_all_elements([this](element_type* p){
|
x.for_all_elements([this](element_type* p){
|
||||||
unchecked_insert(type_policy::moved_value_from(*p));
|
unchecked_insert(type_policy::move(type_policy::value_from(*p)));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -60,11 +60,6 @@ namespace boost {
|
|||||||
std::move(const_cast<raw_mapped_type&>(x.second))};
|
std::move(const_cast<raw_mapped_type&>(x.second))};
|
||||||
}
|
}
|
||||||
|
|
||||||
static moved_type moved_value_from(element_type& x)
|
|
||||||
{
|
|
||||||
return move(x);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class A>
|
template <class A>
|
||||||
static void construct(A& al, element_type* p, moved_type&& x)
|
static void construct(A& al, element_type* p, moved_type&& x)
|
||||||
{
|
{
|
||||||
|
@@ -41,15 +41,10 @@ namespace boost {
|
|||||||
|
|
||||||
using element_type = value_type;
|
using element_type = value_type;
|
||||||
|
|
||||||
static Key const& value_from(element_type const& x) { return x; }
|
static Key& value_from(element_type& x) { return x; }
|
||||||
|
|
||||||
static element_type&& move(element_type& x) { return std::move(x); }
|
static element_type&& move(element_type& x) { return std::move(x); }
|
||||||
|
|
||||||
static element_type&& moved_value_from(element_type& x)
|
|
||||||
{
|
|
||||||
return move(x);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class A>
|
template <class A>
|
||||||
static void construct(A& al, element_type* p, element_type const& copy)
|
static void construct(A& al, element_type* p, element_type const& copy)
|
||||||
{
|
{
|
||||||
|
@@ -41,6 +41,7 @@ namespace boost {
|
|||||||
|
|
||||||
using init_type = std::pair<raw_key_type, raw_mapped_type>;
|
using init_type = std::pair<raw_key_type, raw_mapped_type>;
|
||||||
using value_type = std::pair<Key const, T>;
|
using value_type = std::pair<Key const, T>;
|
||||||
|
using moved_type = std::pair<raw_key_type&&, raw_mapped_type&&>;
|
||||||
|
|
||||||
struct element_type
|
struct element_type
|
||||||
{
|
{
|
||||||
@@ -57,13 +58,6 @@ namespace boost {
|
|||||||
|
|
||||||
static value_type& value_from(element_type x) { return *(x.p); }
|
static value_type& value_from(element_type x) { return *(x.p); }
|
||||||
|
|
||||||
static std::pair<raw_key_type&&, raw_mapped_type&&> moved_value_from(
|
|
||||||
element_type& x)
|
|
||||||
{
|
|
||||||
return {std::move(const_cast<raw_key_type&>(x.p->first)),
|
|
||||||
std::move(const_cast<raw_mapped_type&>(x.p->second))};
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class K, class V>
|
template <class K, class V>
|
||||||
static raw_key_type const& extract(std::pair<K, V> const& kv)
|
static raw_key_type const& extract(std::pair<K, V> const& kv)
|
||||||
{
|
{
|
||||||
@@ -76,6 +70,11 @@ namespace boost {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static element_type&& move(element_type& x) { return std::move(x); }
|
static element_type&& move(element_type& x) { return std::move(x); }
|
||||||
|
static moved_type move(value_type& x)
|
||||||
|
{
|
||||||
|
return {std::move(const_cast<raw_key_type&>(x.first)),
|
||||||
|
std::move(const_cast<raw_mapped_type&>(x.second))};
|
||||||
|
}
|
||||||
|
|
||||||
template <class A>
|
template <class A>
|
||||||
static void construct(A&, element_type* p, element_type&& x)
|
static void construct(A&, element_type* p, element_type&& x)
|
||||||
|
@@ -56,11 +56,7 @@ namespace boost {
|
|||||||
static value_type& value_from(element_type x) { return *x.p; }
|
static value_type& value_from(element_type x) { return *x.p; }
|
||||||
static Key const& extract(element_type k) { return *k.p; }
|
static Key const& extract(element_type k) { return *k.p; }
|
||||||
static element_type&& move(element_type& x) { return std::move(x); }
|
static element_type&& move(element_type& x) { return std::move(x); }
|
||||||
|
static value_type&& move(value_type& x) { return std::move(x); }
|
||||||
static value_type&& moved_value_from(element_type& x)
|
|
||||||
{
|
|
||||||
return std::move(*x.p);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class A>
|
template <class A>
|
||||||
static void construct(A& al, element_type* p, element_type const& copy)
|
static void construct(A& al, element_type* p, element_type const& copy)
|
||||||
|
Reference in New Issue
Block a user