tint: Make tint::ast::HasAttribute() accept multiple template arguments

Change-Id: I42efb3e603ac1d92c77e48784f7a9d010ade3047
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96021
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Ben Clayton 2022-07-26 16:40:15 +00:00 committed by Dawn LUCI CQ
parent a55b686ded
commit 02e9ce19ec
1 changed files with 2 additions and 2 deletions

View File

@ -43,10 +43,10 @@ using AttributeList = std::vector<const Attribute*>;
/// @param attributes the list of attributes to search
/// @returns true if `attributes` includes a attribute of type `T`
template <typename T>
template <typename... Ts>
bool HasAttribute(const AttributeList& attributes) {
for (auto* attr : attributes) {
if (attr->Is<T>()) {
if (attr->IsAnyOf<Ts...>()) {
return true;
}
}