mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-21 15:01:01 +01:00
[iter] Default projection to identity
This commit is contained in:
1 parent
a699c6b17c
commit
83cecd80d9
2 files changed
+5
-5
No files matched your search
+3
-3
@@ -31,7 +31,7 @@
|
||||
#include "hb-null.hh"
|
||||
|
||||
|
||||
static HB_UNUSED struct
|
||||
static HB_UNUSED struct hb_identity_t
|
||||
{
|
||||
template <typename T> T
|
||||
operator () (const T& v) const { return v; }
|
||||
@@ -55,13 +55,13 @@ struct hb_pair_t
|
||||
template <typename T1, typename T2> static inline hb_pair_t<T1, T2>
|
||||
hb_pair (T1 a, T2 b) { return hb_pair_t<T1, T2> (a, b); }
|
||||
|
||||
static HB_UNUSED struct
|
||||
static HB_UNUSED struct hb_first_t
|
||||
{
|
||||
template <typename Pair> typename Pair::first_t
|
||||
operator () (const Pair& pair) const { return pair.first; }
|
||||
} hb_first;
|
||||
|
||||
static HB_UNUSED struct
|
||||
static HB_UNUSED struct hb_second_t
|
||||
{
|
||||
template <typename Pair> typename Pair::second_t
|
||||
operator () (const Pair& pair) const { return pair.second; }
|
||||
|
||||
+2
-2
@@ -280,9 +280,9 @@ struct hb_filter_iter_factory_t
|
||||
Pred p;
|
||||
Proj f;
|
||||
};
|
||||
template <typename Pred, typename Proj>
|
||||
template <typename Pred, typename Proj = hb_identity_t&>
|
||||
inline hb_filter_iter_factory_t<Pred, Proj>
|
||||
hb_filter (Pred&& p, Proj&& f)
|
||||
hb_filter (Pred&& p, Proj&& f = hb_identity)
|
||||
{ return hb_filter_iter_factory_t<Pred, Proj> (p, f); }
|
||||
|
||||
/* hb_zip() */
|
||||
|
||||
Reference in new issue
Block a user