[algs] Declare coerce() as constexpr

This commit is contained in:
Behdad Esfahbod 2022-05-19 16:06:21 -06:00
parent 2fdb7616f5
commit b4d1ec310c
1 changed files with 2 additions and 2 deletions

View File

@ -229,11 +229,11 @@ HB_FUNCOBJ (hb_bool);
template <typename T>
static inline
T hb_coerce (const T v) { return v; }
constexpr T hb_coerce (const T v) { return v; }
template <typename T, typename V,
hb_enable_if (!hb_is_same (hb_decay<T>, hb_decay<V>) && std::is_pointer<V>::value)>
static inline
T hb_coerce (const V v) { return *v; }
constexpr T hb_coerce (const V v) { return *v; }
struct
{