[meta] Add hb_move and hb_forward ala std::

This commit is contained in:
Behdad Esfahbod 2019-03-30 18:19:36 -07:00
parent 9a19b885f9
commit 7c9ceabcef
1 changed files with 11 additions and 0 deletions

View File

@ -72,6 +72,17 @@ static const struct
} hb_deref_pointer HB_UNUSED;
/* std::move and std::forward */
template <typename T>
hb_remove_reference (T)&& hb_move (T&& t) { return (hb_remove_reference (T)&&) (t); }
template <typename T>
T&& hb_forward (hb_remove_reference (T)& t) { return (T&&) t; }
template <typename T>
T&& hb_forward (hb_remove_reference (T)&& t) { return (T&&) t; }
/* Void! For when we need a expression-type of void. */
struct hb_void_t { typedef void value; };