Move traits into utils.

This CL moves the tint/traits file into tint/utils/traits. Traits is one
of the few items not in utils which is referred to by utils.

Change-Id: Ie955398f24e949b7618fdc868dbcb903fe20b3f1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127400
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair
2023-04-19 16:52:46 +00:00
committed by Dawn LUCI CQ
parent b7285f3c9e
commit 0559005494
20 changed files with 128 additions and 105 deletions

View File

@@ -65,9 +65,9 @@ class Manager final {
/// constructed, then the same pointer is returned.
template <typename NODE, typename... ARGS>
NODE* Get(ARGS&&... args) {
if constexpr (traits::IsTypeOrDerived<NODE, Type>) {
if constexpr (utils::traits::IsTypeOrDerived<NODE, Type>) {
return types_.Get<NODE>(std::forward<ARGS>(args)...);
} else if constexpr (traits::IsTypeOrDerived<NODE, UniqueNode>) {
} else if constexpr (utils::traits::IsTypeOrDerived<NODE, UniqueNode>) {
return unique_nodes_.Get<NODE>(std::forward<ARGS>(args)...);
} else {
return nodes_.Create<NODE>(std::forward<ARGS>(args)...);
@@ -78,7 +78,7 @@ class Manager final {
/// @return a pointer to an instance of `T` with the provided arguments, or nullptr if the item
/// was not found.
template <typename TYPE,
typename _ = std::enable_if<traits::IsTypeOrDerived<TYPE, Type>>,
typename _ = std::enable_if<utils::traits::IsTypeOrDerived<TYPE, Type>>,
typename... ARGS>
TYPE* Find(ARGS&&... args) const {
return types_.Find<TYPE>(std::forward<ARGS>(args)...);