diff --git a/headers/meta.hpp/meta_utilities.hpp b/headers/meta.hpp/meta_utilities.hpp index c4ec2bb..5d3f16c 100644 --- a/headers/meta.hpp/meta_utilities.hpp +++ b/headers/meta.hpp/meta_utilities.hpp @@ -105,14 +105,13 @@ namespace meta_hpp class value final { public: value() = default; + ~value() = default; - value(value&& other) noexcept = default; + value(value&& other) = default; value(const value& other) = default; - value& operator=(value&& other) noexcept; - value& operator=(const value& other); - - ~value() = default; + value& operator=(value&& other) = default; + value& operator=(const value& other) = default; template < detail::decay_non_uvalue_kind T > requires detail::stdex::copy_constructible> diff --git a/headers/meta.hpp/meta_utilities/value.hpp b/headers/meta.hpp/meta_utilities/value.hpp index 9364fb0..dac1b7a 100644 --- a/headers/meta.hpp/meta_utilities/value.hpp +++ b/headers/meta.hpp/meta_utilities/value.hpp @@ -107,22 +107,6 @@ namespace meta_hpp namespace meta_hpp { - inline value& value::operator=(value&& other) noexcept { - if ( this != &other ) { - value temp{std::move(other)}; - swap(temp); - } - return *this; - } - - inline value& value::operator=(const value& other) { - if ( this != &other ) { - value temp{other}; - swap(temp); - } - return *this; - } - template < detail::decay_non_uvalue_kind T > requires detail::stdex::copy_constructible> value::value(T&& val) diff --git a/untests/meta_utilities/value_tests.cpp b/untests/meta_utilities/value_tests.cpp index 4f97bd6..007afdf 100644 --- a/untests/meta_utilities/value_tests.cpp +++ b/untests/meta_utilities/value_tests.cpp @@ -12,7 +12,7 @@ namespace int x{}; int y{}; - ivec2() = default; + ivec2() = delete; explicit ivec2(int v): x{v}, y{v} {} ivec2(int x, int y): x{x}, y{y} {} @@ -48,7 +48,7 @@ namespace int y{}; int z{}; - ivec3() = default; + ivec3() = delete; explicit ivec3(int v): x{v}, y{v}, z{v} {} ivec3(int x, int y, int z): x{x}, y{y}, z{z} {} }; @@ -73,7 +73,6 @@ TEST_CASE("meta/meta_utilities/value/ivec2") { namespace meta = meta_hpp; meta::class_() - .ctor_<>() .ctor_() .ctor_() .ctor_() @@ -86,7 +85,6 @@ TEST_CASE("meta/meta_utilities/value/ivec3") { namespace meta = meta_hpp; meta::class_() - .ctor_<>() .ctor_() .ctor_() .ctor_() @@ -362,7 +360,7 @@ TEST_CASE("meta/meta_utilities/value") { val_dst = std::move(val_src2); CHECK(val_dst == ivec2{1,2}); - CHECK(ivec2::move_ctor_counter == 4); + CHECK(ivec2::move_ctor_counter == 3); CHECK(ivec2::copy_ctor_counter == 0); } @@ -381,7 +379,7 @@ TEST_CASE("meta/meta_utilities/value") { val_dst = val_src2; CHECK(val_dst == ivec2{1,2}); - CHECK(ivec2::move_ctor_counter == 3); + CHECK(ivec2::move_ctor_counter == 2); CHECK(ivec2::copy_ctor_counter == 1); CHECK(val_src2 == ivec2{1,2});