Add move assignment operators to tint::ast::Module and tint::Context

This enables usage with DAWN_TRY_ASSIGN in Dawn in simplify error
handling.

Bug: tint:306
Change-Id: I91a96b6670341943c26d9972058ecc3ad8162db0
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34640
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Austin Eng 2020-12-02 04:27:08 +00:00 committed by Commit Bot service account
parent 31f55c6517
commit bf5e6b98cc
4 changed files with 6 additions and 0 deletions

View File

@ -25,6 +25,7 @@ namespace ast {
Module::Module() = default;
Module::Module(Module&&) = default;
Module& Module::operator=(Module&& rhs) = default;
Module::~Module() = default;

View File

@ -40,6 +40,8 @@ class Module {
Module();
/// Move constructor
Module(Module&&);
// Move assignment
Module& operator=(Module&& rhs);
~Module();
/// @return a deep copy of this module

View File

@ -21,6 +21,7 @@ namespace ast {
TypeManager::TypeManager() = default;
TypeManager::TypeManager(TypeManager&&) = default;
TypeManager& TypeManager::operator=(TypeManager&& rhs) = default;
TypeManager::~TypeManager() = default;
void TypeManager::Reset() {

View File

@ -31,6 +31,8 @@ class TypeManager {
TypeManager();
/// Move constructor
TypeManager(TypeManager&&);
// Move assignment
TypeManager& operator=(TypeManager&& rhs);
~TypeManager();
/// Clears all registered types.