Adjust is_cr_convertible

If To is const& then From doesn't need to be &.
This commit is contained in:
Behdad Esfahbod 2019-05-09 15:09:07 -07:00
parent 726002a6a6
commit 3686c3b65c

View File

@ -116,10 +116,16 @@ template <typename T> using hb_remove_pointer = typename hb_match_pointer<T>::ty
/* TODO Add feature-parity to std::decay. */
template <typename T> using hb_decay = hb_remove_const<hb_remove_reference<T>>;
#define hb_is_cr_convertible(From, To) ( \
hb_is_same (hb_decay<From>, hb_decay<To>) && \
hb_is_const (From) <= hb_is_const (To) && \
hb_is_reference (From) >= hb_is_reference (To))
#define hb_is_cr_convertible(From, To) \
( \
hb_is_same (hb_decay<From>, hb_decay<To>) && \
( \
hb_is_const (From) <= hb_is_const (To) && \
hb_is_reference (From) >= hb_is_reference (To) \
) || ( \
hb_is_const (To) && hb_is_reference (To) \
) \
)