/* Range-based 'for' for iterables. */
template <typename Iterable,
- hb_enable_if (hb_is_iterable (Iterable))>
+ hb_requires (hb_is_iterable (Iterable))>
static inline auto begin (Iterable&& iterable) HB_AUTO_RETURN (hb_iter (iterable).begin ())
template <typename Iterable,
- hb_enable_if (hb_is_iterable (Iterable))>
+ hb_requires (hb_is_iterable (Iterable))>
static inline auto end (Iterable&& iterable) HB_AUTO_RETURN (hb_iter (iterable).end ())
/* begin()/end() are NOT looked up non-ADL. So each namespace must declare them.
namespace OT {
template <typename Iterable,
- hb_enable_if (hb_is_iterable (Iterable))>
+ hb_requires (hb_is_iterable (Iterable))>
static inline auto begin (Iterable&& iterable) HB_AUTO_RETURN (hb_iter (iterable).begin ())
template <typename Iterable,
- hb_enable_if (hb_is_iterable (Iterable))>
+ hb_requires (hb_is_iterable (Iterable))>
static inline auto end (Iterable&& iterable) HB_AUTO_RETURN (hb_iter (iterable).end ())
}
*/
template <typename Lhs, typename Rhs,
- hb_enable_if (hb_is_iterator (Lhs))>
+ hb_requires (hb_is_iterator (Lhs))>
static inline auto
operator | (Lhs lhs, const Rhs &rhs) HB_AUTO_RETURN (rhs (lhs))
/* hb_map(), hb_filter(), hb_reduce() */
template <typename Iter, typename Proj,
- hb_enable_if (hb_is_iterator (Iter))>
+ hb_requires (hb_is_iterator (Iter))>
struct hb_map_iter_t :
hb_iter_t<hb_map_iter_t<Iter, Proj>,
decltype (hb_declval (Proj) (hb_declval (typename Iter::item_t)))>
hb_map_iter_factory_t (Proj f) : f (f) {}
template <typename Iter,
- hb_enable_if (hb_is_iterator (Iter))>
+ hb_requires (hb_is_iterator (Iter))>
hb_map_iter_t<Iter, Proj>
operator () (Iter it) const
{ return hb_map_iter_t<Iter, Proj> (it, f); }
HB_FUNCOBJ (hb_map);
template <typename Iter, typename Pred, typename Proj,
- hb_enable_if (hb_is_iterator (Iter))>
+ hb_requires (hb_is_iterator (Iter))>
struct hb_filter_iter_t :
hb_iter_with_fallback_t<hb_filter_iter_t<Iter, Pred, Proj>,
typename Iter::item_t>
hb_filter_iter_factory_t (Pred p, Proj f) : p (p), f (f) {}
template <typename Iter,
- hb_enable_if (hb_is_iterator (Iter))>
+ hb_requires (hb_is_iterator (Iter))>
hb_filter_iter_t<Iter, Pred, Proj>
operator () (Iter it) const
{ return hb_filter_iter_t<Iter, Pred, Proj> (it, p, f); }
hb_reduce_t (Redu r, InitT init_value) : r (r), init_value (init_value) {}
template <typename Iter,
- hb_enable_if (hb_is_iterator (Iter)),
+ hb_requires (hb_is_iterator (Iter)),
typename AccuT = decltype (hb_declval (Redu) (hb_declval (InitT), hb_declval (typename Iter::item_t)))>
AccuT
operator () (Iter it) const
struct
{
template <typename A, typename B,
- hb_enable_if (hb_is_iterable (A) && hb_is_iterable (B))>
+ hb_requires (hb_is_iterable (A) && hb_is_iterable (B))>
hb_zip_iter_t<hb_iter_t (A), hb_iter_t (B)>
operator () (A& a, B &b) const
{ return hb_zip_iter_t<hb_iter_t (A), hb_iter_t (B)> (hb_iter (a), hb_iter (b)); }
/* hb_enumerate */
template <typename Iter,
- hb_enable_if (hb_is_iterator (Iter))>
+ hb_requires (hb_is_iterator (Iter))>
struct hb_enumerate_iter_t :
hb_iter_t<hb_enumerate_iter_t<Iter>,
hb_pair_t<unsigned, typename Iter::item_t>>
struct
{
template <typename Iterable,
- hb_enable_if (hb_is_iterable (Iterable))>
+ hb_requires (hb_is_iterable (Iterable))>
hb_enumerate_iter_t<hb_iter_t (Iterable)>
operator () (Iterable& it) const
{ return hb_enumerate_iter_t<hb_iter_t (Iterable)> (hb_iter (it)); }
hb_apply_t (Appl a) : a (a) {}
template <typename Iter,
- hb_enable_if (hb_is_iterator (Iter))>
- void
- operator () (Iter it) const
+ hb_requires (hb_is_iterator (Iter))>
+ void operator () (Iter it) const
{
for (; it; ++it)
(void) hb_invoke (a, *it);
hb_sink_t (Sink&& s) : s (s) {}
template <typename Iter,
- hb_enable_if (hb_is_iterator (Iter))>
- void
- operator () (Iter it) const
+ hb_requires (hb_is_iterator (Iter))>
+ void operator () (Iter it) const
{
for (; it; ++it)
s << *it;
struct
{
template <typename Iter,
- hb_enable_if (hb_is_iterator (Iter))>
- void
- operator () (Iter it) const
+ hb_requires (hb_is_iterator (Iter))>
+ void operator () (Iter it) const
{
for (; it; ++it)
(void) *it;
hb_unzip_t (Sink1&& s1, Sink2&& s2) : s1 (s1), s2 (s2) {}
template <typename Iter,
- hb_enable_if (hb_is_iterator (Iter))>
- void
- operator () (Iter it) const
+ hb_requires (hb_is_iterator (Iter))>
+ void operator () (Iter it) const
{
for (; it; ++it)
{
struct
{
template <typename Iterable,
- hb_enable_if (hb_is_iterable (Iterable))>
- bool
- operator () (Iterable&& c) const
+ hb_requires (hb_is_iterable (Iterable))>
+ bool operator () (Iterable&& c) const
{
for (auto it = hb_iter (c); it; ++it)
if (!*it)
struct
{
template <typename Iterable,
- hb_enable_if (hb_is_iterable (Iterable))>
- bool
- operator () (Iterable&& c) const
+ hb_requires (hb_is_iterable (Iterable))>
+ bool operator () (Iterable&& c) const
{
for (auto it = hb_iter (c); it; ++it)
if (*it)
struct
{
template <typename Iterable,
- hb_enable_if (hb_is_iterable (Iterable))>
- bool
- operator () (Iterable&& c) const
+ hb_requires (hb_is_iterable (Iterable))>
+ bool operator () (Iterable&& c) const
{
for (auto it = hb_iter (c); it; ++it)
if (*it)
*/
template <typename C, typename V,
- hb_enable_if (hb_is_iterable (C))>
+ hb_requires (hb_is_iterable (C))>
inline void
hb_fill (C& c, const V &v)
{