struct
{
+ /* Note. This is dangerous in that if it's passed an rvalue, it returns rvalue-reference. */
template <typename T> auto
operator () (T&& v) const HB_AUTO_RETURN ( hb_forward<T> (v) )
}
HB_FUNCOBJ (hb_identity);
+struct
+{
+ /* Like identity(), but only retains lvalue-references. Rvalues are returned as rvalues. */
+ template <typename T> T&
+ operator () (T& v) const { return v; }
+ template <typename T> hb_remove_reference<T>
+ operator () (T&& v) const { return v; }
+}
+HB_FUNCOBJ (hb_lidentity);
struct
{
+ /* Like identity(), but always returns rvalue. */
template <typename T> hb_remove_reference<T>
operator () (T&& v) const { return v; }
}
-HB_FUNCOBJ (hb_rvalue);
+HB_FUNCOBJ (hb_ridentity);
struct
{
+ hb_array (items, mask ? mask + 1 : 0)
| hb_filter (&item_t::is_real)
| hb_map (&item_t::key)
- | hb_map (hb_rvalue)
+ | hb_map (hb_ridentity)
)
auto values () const HB_AUTO_RETURN
(
+ hb_array (items, mask ? mask + 1 : 0)
| hb_filter (&item_t::is_real)
| hb_map (&item_t::value)
- | hb_map (hb_rvalue)
+ | hb_map (hb_ridentity)
)
protected:
test_iterator_non_default_constructable (hb_enumerate (hb_iter (st)));
test_iterator_non_default_constructable (hb_enumerate (hb_iter (st) + 1));
test_iterator_non_default_constructable (hb_iter (st) | hb_filter ());
- test_iterator_non_default_constructable (hb_iter (st) | hb_map (hb_rvalue));
+ test_iterator_non_default_constructable (hb_iter (st) | hb_map (hb_lidentity));
assert (true == hb_all (st));
assert (false == hb_all (st, 42u));