SilensAngelusNex added inline comments.
================
Comment at: clang/include/clang/ASTMatchers/ASTMatchersInternal.h:138-150
+template <typename... T> struct disjunction;
+template <typename T> struct disjunction<T> : public T {};
+template <typename Head, typename... Tail> struct disjunction<Head, Tail...> {
+ using type =
+ typename std::conditional<Head::value, Head, disjunction<Tail...>>::type;
+ static constexpr bool value = type::value;
+};
----------------
Is there a better way to express this? I was originally using
```
template <typename... Expected> struct is_one_of {
template <typename T>
static constexpr bool value = (std::is_base_of_v<Expected, T> || ...);
};
```
but that didn't compile because `is_base_of_v` and fold expressions are C++17
features.
Maybe it would be better to just explicitly write out an overload of
`GetTypeSourceInfo` for each type?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101572/new/
https://reviews.llvm.org/D101572
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits