diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-05-29 09:47:28 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-06-03 17:32:18 +0000 |
commit | f4ba0238f2f38334f97508146fce30aa43699a33 (patch) | |
tree | e3149411a53cf329c000e54ca1e084401b83fc39 | |
parent | 2f2d1920c5194faa969d67675d20025496ee645f (diff) | |
download | qtwebengine-chromium-f4ba0238f2f38334f97508146fce30aa43699a33.tar.gz |
[harfbuzz-ng] [iter] Use different SFINAE scheme to make MSVC happy
Cherry-pick to fix MSVC builds
Change-Id: I43b830595119cc57e592c60bbf351ab2a68cc36a
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rw-r--r-- | chromium/third_party/harfbuzz-ng/src/src/hb-iter.hh | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/chromium/third_party/harfbuzz-ng/src/src/hb-iter.hh b/chromium/third_party/harfbuzz-ng/src/src/hb-iter.hh index b212aa30306..98a65b7e9fe 100644 --- a/chromium/third_party/harfbuzz-ng/src/src/hb-iter.hh +++ b/chromium/third_party/harfbuzz-ng/src/src/hb-iter.hh @@ -202,15 +202,18 @@ struct hb_iter_with_fallback_t : /* hb_is_iterable() */ -template<typename T, typename B> -struct _hb_is_iterable -{ enum { value = false }; }; -template<typename T> -struct _hb_is_iterable<T, hb_bool_tt<true || sizeof (hb_declval (T).iter ())> > -{ enum { value = true }; }; - -template<typename T> -struct hb_is_iterable { enum { value = _hb_is_iterable<T, hb_true_t>::value }; }; +template <typename T> +struct hb_is_iterable +{ + private: + template <typename U> + static auto test (int) -> decltype (hb_declval (U).iter (), hb_true_t ()); + template <typename> + static hb_false_t test (...); + + public: + enum { value = decltype (test<T> (0))::value }; +}; #define hb_is_iterable(Iterable) hb_is_iterable<Iterable>::value /* TODO Add hb_is_iterable_of(). |