Fix compile

NameRecord is not copy-constructible, so should be iterator of
const-reference.
This commit is contained in:
Behdad Esfahbod 2019-05-09 15:19:42 -07:00
parent 3686c3b65c
commit ceda1f03b7
3 changed files with 13 additions and 3 deletions

View File

@ -157,8 +157,6 @@ struct hb_is_convertible
(!either_void && (!either_void &&
decltype (impl<hb_conditional<from_void, int, From>> (hb_prioritize))::value); decltype (impl<hb_conditional<from_void, int, From>> (hb_prioritize))::value);
}; };
#define hb_is_convertible(From,To) hb_is_convertible<From, To>::value #define hb_is_convertible(From,To) hb_is_convertible<From, To>::value

View File

@ -170,7 +170,7 @@ struct name
{ return min_size + count * nameRecordZ.item_size; } { return min_size + count * nameRecordZ.item_size; }
template <typename Iterator, template <typename Iterator,
hb_requires (hb_is_iterator_of (Iterator, const NameRecord))> hb_requires (hb_is_iterator_of (Iterator, const NameRecord &))>
bool serialize (hb_serialize_context_t *c, bool serialize (hb_serialize_context_t *c,
Iterator it, Iterator it,
const void *src_string_pool) const void *src_string_pool)

View File

@ -55,6 +55,18 @@ main (int argc, char **argv)
static_assert (hb_is_convertible (int&, const int)); static_assert (hb_is_convertible (int&, const int));
static_assert (hb_is_convertible (const int&, int)); static_assert (hb_is_convertible (const int&, int));
static_assert (hb_is_convertible (const int&, const int)); static_assert (hb_is_convertible (const int&, const int));
static_assert (hb_is_convertible (const int&, const int));
struct X {};
static_assert (hb_is_convertible (const X &, const X));
static_assert (hb_is_convertible (X &, const X));
static_assert (hb_is_convertible (X &, const X &));
static_assert (hb_is_convertible (X, const X &));
static_assert (hb_is_convertible (const X, const X &));
static_assert (!hb_is_convertible (const X, X &));
static_assert (!hb_is_convertible (X, X &));
static_assert (hb_is_convertible (X &, X &));
static_assert (hb_is_convertible (int&, long)); static_assert (hb_is_convertible (int&, long));
static_assert (!hb_is_convertible (int&, long&)); static_assert (!hb_is_convertible (int&, long&));