mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-16 14:09:02 +07:00
rename "uvalue::get_as" to "uvalue::as"
This commit is contained in:
@@ -147,7 +147,7 @@ TEST_CASE("meta/meta_utilities/value2/counters/small") {
|
||||
meta::uvalue v2{std::move(v1)};
|
||||
|
||||
CHECK_FALSE(v1);
|
||||
CHECK(v2.get_as<ivec2>().x == 1);
|
||||
CHECK(v2.as<ivec2>().x == 1);
|
||||
|
||||
CHECK(ivec2::destructor_counter == 2);
|
||||
CHECK(ivec2::move_constructor_counter == 2);
|
||||
@@ -163,8 +163,8 @@ TEST_CASE("meta/meta_utilities/value2/counters/small") {
|
||||
meta::uvalue v1{ivec2{1,2}};
|
||||
meta::uvalue v2{std::as_const(v1)};
|
||||
|
||||
CHECK(v1.get_as<ivec2>().x == 1);
|
||||
CHECK(v2.get_as<ivec2>().y == 2);
|
||||
CHECK(v1.as<ivec2>().x == 1);
|
||||
CHECK(v2.as<ivec2>().y == 2);
|
||||
|
||||
CHECK(ivec2::destructor_counter == 1);
|
||||
CHECK(ivec2::move_constructor_counter == 1);
|
||||
@@ -184,8 +184,8 @@ TEST_CASE("meta/meta_utilities/value2/counters/small") {
|
||||
CHECK(ivec2::copy_constructor_counter == 0);
|
||||
|
||||
v1.swap(v2);
|
||||
CHECK(v1.get_as<ivec2>().x == 3);
|
||||
CHECK(v2.get_as<ivec2>().x == 1);
|
||||
CHECK(v1.as<ivec2>().x == 3);
|
||||
CHECK(v2.as<ivec2>().x == 1);
|
||||
|
||||
CHECK((ivec2::destructor_counter == 5 || ivec2::destructor_counter == 6));
|
||||
CHECK((ivec2::move_constructor_counter == 5 || ivec2::move_constructor_counter == 6));
|
||||
@@ -234,7 +234,7 @@ TEST_CASE("meta/meta_utilities/value2/counters/big") {
|
||||
meta::uvalue v2{std::move(v1)};
|
||||
|
||||
CHECK_FALSE(v1);
|
||||
CHECK(v2.get_as<ivec2_big>().x == 1);
|
||||
CHECK(v2.as<ivec2_big>().x == 1);
|
||||
|
||||
CHECK(ivec2_big::destructor_counter == 1);
|
||||
CHECK(ivec2_big::move_constructor_counter == 1);
|
||||
@@ -250,8 +250,8 @@ TEST_CASE("meta/meta_utilities/value2/counters/big") {
|
||||
meta::uvalue v1{ivec2_big{1,2}};
|
||||
meta::uvalue v2{std::as_const(v1)};
|
||||
|
||||
CHECK(v1.get_as<ivec2_big>().x == 1);
|
||||
CHECK(v2.get_as<ivec2_big>().y == 2);
|
||||
CHECK(v1.as<ivec2_big>().x == 1);
|
||||
CHECK(v2.as<ivec2_big>().y == 2);
|
||||
|
||||
CHECK(ivec2_big::destructor_counter == 1);
|
||||
CHECK(ivec2_big::move_constructor_counter == 1);
|
||||
@@ -271,8 +271,8 @@ TEST_CASE("meta/meta_utilities/value2/counters/big") {
|
||||
CHECK(ivec2_big::copy_constructor_counter == 0);
|
||||
|
||||
v1.swap(v2);
|
||||
CHECK(v1.get_as<ivec2_big>().x == 3);
|
||||
CHECK(v2.get_as<ivec2_big>().x == 1);
|
||||
CHECK(v1.as<ivec2_big>().x == 3);
|
||||
CHECK(v2.as<ivec2_big>().x == 1);
|
||||
|
||||
CHECK(ivec2_big::destructor_counter == 2);
|
||||
CHECK(ivec2_big::move_constructor_counter == 2);
|
||||
@@ -305,7 +305,7 @@ TEST_CASE("meta/meta_utilities/value2/counters/swap") {
|
||||
CHECK(ivec2::copy_constructor_counter == 0);
|
||||
|
||||
v1.swap(v2);
|
||||
CHECK(v1.get_as<ivec2>().x == 1);
|
||||
CHECK(v1.as<ivec2>().x == 1);
|
||||
CHECK_FALSE(v2);
|
||||
|
||||
CHECK(ivec2::destructor_counter == 2);
|
||||
@@ -314,7 +314,7 @@ TEST_CASE("meta/meta_utilities/value2/counters/swap") {
|
||||
|
||||
v1.swap(v2);
|
||||
CHECK_FALSE(v1);
|
||||
CHECK(v2.get_as<ivec2>().y == 2);
|
||||
CHECK(v2.as<ivec2>().y == 2);
|
||||
|
||||
CHECK(ivec2::destructor_counter == 3);
|
||||
CHECK(ivec2::move_constructor_counter == 3);
|
||||
@@ -336,7 +336,7 @@ TEST_CASE("meta/meta_utilities/value2/counters/swap") {
|
||||
CHECK(ivec2_big::copy_constructor_counter == 0);
|
||||
|
||||
v1.swap(v2);
|
||||
CHECK(v1.get_as<ivec2_big>().x == 3);
|
||||
CHECK(v1.as<ivec2_big>().x == 3);
|
||||
CHECK_FALSE(v2);
|
||||
|
||||
CHECK(ivec2_big::destructor_counter == 1);
|
||||
@@ -345,7 +345,7 @@ TEST_CASE("meta/meta_utilities/value2/counters/swap") {
|
||||
|
||||
v1.swap(v2);
|
||||
CHECK_FALSE(v1);
|
||||
CHECK(v2.get_as<ivec2_big>().y == 4);
|
||||
CHECK(v2.as<ivec2_big>().y == 4);
|
||||
|
||||
CHECK(ivec2_big::destructor_counter == 1);
|
||||
CHECK(ivec2_big::move_constructor_counter == 1);
|
||||
@@ -371,8 +371,8 @@ TEST_CASE("meta/meta_utilities/value2/counters/swap") {
|
||||
CHECK(ivec2_big::copy_constructor_counter == 0);
|
||||
|
||||
v1.swap(v2);
|
||||
CHECK(v1.get_as<ivec2_big>().x == 3);
|
||||
CHECK(v2.get_as<ivec2>().x == 1);
|
||||
CHECK(v1.as<ivec2_big>().x == 3);
|
||||
CHECK(v2.as<ivec2>().x == 1);
|
||||
|
||||
CHECK(ivec2::destructor_counter == 2);
|
||||
CHECK(ivec2::move_constructor_counter == 2);
|
||||
@@ -383,8 +383,8 @@ TEST_CASE("meta/meta_utilities/value2/counters/swap") {
|
||||
CHECK(ivec2_big::copy_constructor_counter == 0);
|
||||
|
||||
v1.swap(v2);
|
||||
CHECK(v1.get_as<ivec2>().y == 2);
|
||||
CHECK(v2.get_as<ivec2_big>().y == 4);
|
||||
CHECK(v1.as<ivec2>().y == 2);
|
||||
CHECK(v2.as<ivec2_big>().y == 4);
|
||||
|
||||
CHECK(ivec2::destructor_counter == 3);
|
||||
CHECK(ivec2::move_constructor_counter == 3);
|
||||
|
||||
Reference in New Issue
Block a user