提交 71157a45 编写于 作者: B Behdad Esfahbod

[meta] Remove _ft struct names

Using decltype() instead.
上级 9103bd05
......@@ -31,13 +31,13 @@
#include "hb-null.hh"
static const struct hb_identity_ft
static const struct
{
template <typename T> T
operator () (const T& v) const { return v; }
} hb_identity HB_UNUSED;
static const struct hb_bool_ft
static const struct
{
template <typename T> bool
operator () (const T& v) const { return bool (v); }
......@@ -61,13 +61,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 const struct hb_first_ft
static const struct
{
template <typename Pair> decltype (hb_declval (Pair).first)
operator () (const Pair& pair) const { return pair.first; }
} hb_first HB_UNUSED;
static const struct hb_second_ft
static const struct
{
template <typename Pair> decltype (hb_declval (Pair).second)
operator () (const Pair& pair) const { return pair.second; }
......
......@@ -301,7 +301,7 @@ struct hb_filter_iter_factory_t
Pred p;
Proj f;
};
template <typename Pred = const hb_bool_ft&, typename Proj = const hb_identity_ft&>
template <typename Pred = decltype ((hb_bool)), typename Proj = decltype ((hb_identity))>
inline hb_filter_iter_factory_t<Pred, Proj>
hb_filter (Pred&& p = hb_bool, Proj&& f = hb_identity)
{ return hb_filter_iter_factory_t<Pred, Proj> (p, f); }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册