[algs] Use std::move instead of hb_move()

This commit is contained in:
Behdad Esfahbod 2021-11-02 00:14:34 -06:00
parent 896e0c74a8
commit 811f80a701
4 changed files with 6 additions and 8 deletions

View File

@ -159,7 +159,7 @@ struct hb_hashmap_t
if (old_items[i].is_real ())
set_with_hash (old_items[i].key,
old_items[i].hash,
hb_move (old_items[i].value));
std::move (old_items[i].value));
hb_free (old_items);
@ -167,7 +167,7 @@ struct hb_hashmap_t
}
bool set (K key, const V& value) { return set_with_hash (key, hb_hash (key), value); }
bool set (K key, V&& value) { return set_with_hash (key, hb_hash (key), hb_move (value)); }
bool set (K key, V&& value) { return set_with_hash (key, hb_hash (key), std::move (value)); }
V get (K key) const
{

View File

@ -30,6 +30,7 @@
#include "hb.hh"
#include <type_traits>
#include <utility>
/*
@ -174,10 +175,7 @@ using hb_is_cr_convertible = hb_bool_constant<
>;
#define hb_is_cr_convertible(From,To) hb_is_cr_convertible<From, To>::value
/* std::move and std::forward */
template <typename T>
static constexpr hb_remove_reference<T>&& hb_move (T&& t) { return (hb_remove_reference<T>&&) (t); }
/* std::forward */
template <typename T>
static constexpr T&& hb_forward (hb_remove_reference<T>& t) { return (T&&) t; }

View File

@ -42,7 +42,7 @@ struct hb_sparseset_t
~hb_sparseset_t () { fini (); }
hb_sparseset_t (const hb_sparseset_t& other) : hb_sparseset_t () { set (other); }
hb_sparseset_t (hb_sparseset_t&& other) : hb_sparseset_t () { s = hb_move (other.s); }
hb_sparseset_t (hb_sparseset_t&& other) : hb_sparseset_t () { s = std::move (other.s); }
hb_sparseset_t& operator= (const hb_sparseset_t& other) { set (other); return *this; }
hb_sparseset_t& operator= (hb_sparseset_t&& other) { hb_swap (*this, other); return *this; }
friend void swap (hb_sparseset_t& a, hb_sparseset_t& b) { hb_swap (a.s, b.s); }

View File

@ -255,7 +255,7 @@ struct hb_vector_t
Type pop ()
{
if (!length) return Null (Type);
return hb_move (arrayZ[--length]); /* Does this move actually work? */
return std::move (arrayZ[--length]); /* Does this move actually work? */
}
void remove (unsigned int i)