diff --git a/headers/meta.hpp/meta_states/function.hpp b/headers/meta.hpp/meta_states/function.hpp index 1d8a25c..3f7299f 100644 --- a/headers/meta.hpp/meta_states/function.hpp +++ b/headers/meta.hpp/meta_states/function.hpp @@ -49,7 +49,7 @@ namespace meta_hpp::detail std::ignore = std::invoke( std::move(function), (args.data() + Is)->cast>()...); - return {}; + return value{}; } else { return_type&& return_value = std::invoke( std::move(function), diff --git a/headers/meta.hpp/meta_states/method.hpp b/headers/meta.hpp/meta_states/method.hpp index 762b0d4..deb11a6 100644 --- a/headers/meta.hpp/meta_states/method.hpp +++ b/headers/meta.hpp/meta_states/method.hpp @@ -56,7 +56,7 @@ namespace meta_hpp::detail std::move(method), inst.cast(), (args.data() + Is)->cast>()...); - return {}; + return value{}; } else { return_type&& return_value = std::invoke( std::move(method), diff --git a/headers/meta.hpp/meta_types/class_type.hpp b/headers/meta.hpp/meta_types/class_type.hpp index de4aebc..09d2459 100644 --- a/headers/meta.hpp/meta_types/class_type.hpp +++ b/headers/meta.hpp/meta_types/class_type.hpp @@ -109,7 +109,7 @@ namespace meta_hpp return ctor.second.invoke(std::forward(args)...); } } - return {}; + return value{}; } template < typename... Args > diff --git a/manuals/meta_examples/classes_example.cpp b/manuals/meta_examples/classes_example.cpp index ea6b6aa..ad71d88 100644 --- a/manuals/meta_examples/classes_example.cpp +++ b/manuals/meta_examples/classes_example.cpp @@ -71,7 +71,7 @@ TEST_CASE("meta/meta_examples/classes/usage") { const meta::method rectangle_area = rectangle_type.get_method("get_area"); // creates a rectangle instance by the registered constructor(int, int) - const meta::value rectangle_v = rectangle_type.create(10, 20).value(); + const meta::value rectangle_v = rectangle_type.create(10, 20); // calls the method with the dynamic rectangle instance 'rectangle_v' CHECK(rectangle_area.invoke(rectangle_v) == 200); diff --git a/manuals/meta_examples/enums_examples.cpp b/manuals/meta_examples/enums_examples.cpp index f5970dc..123444e 100644 --- a/manuals/meta_examples/enums_examples.cpp +++ b/manuals/meta_examples/enums_examples.cpp @@ -49,11 +49,11 @@ TEST_CASE("meta/meta_examples/enums/usage") { const meta::enum_type align_type = meta::resolve_type(e); // converts the enumerator to its name - CHECK(align_type.value_to_name(e).value() == "center"); + CHECK(align_type.value_to_name(e) == "center"); // also, it works with dynamic value types - CHECK(align_type.value_to_name(meta::value{e}).value() == "center"); + CHECK(align_type.value_to_name(meta::value{e}) == "center"); // ... and back again - CHECK(align_type.name_to_value("center").value() == e); + CHECK(align_type.name_to_value("center") == e); } diff --git a/manuals/meta_examples/functions_example.cpp b/manuals/meta_examples/functions_example.cpp index b2b08c4..a5f5873 100644 --- a/manuals/meta_examples/functions_example.cpp +++ b/manuals/meta_examples/functions_example.cpp @@ -59,7 +59,7 @@ TEST_CASE("meta/meta_examples/functions/usage") { CHECK(sub_function.is_invocable_with()); // calls the function and retrieves a returned value - const meta::value sub_result_value = sub_function.invoke(60, 18).value(); + const meta::value sub_result_value = sub_function.invoke(60, 18); // checks the type of the returned value CHECK(sub_result_value.get_type() == meta::resolve_type()); diff --git a/manuals/meta_examples/methods_example.cpp b/manuals/meta_examples/methods_example.cpp index ddd4a48..5d1f170 100644 --- a/manuals/meta_examples/methods_example.cpp +++ b/manuals/meta_examples/methods_example.cpp @@ -69,7 +69,7 @@ TEST_CASE("meta/meta_examples/methods/usage") { CHECK(ivec2_add.is_invocable_with()); // calls the method and retrieves a returned value - const meta::value ivec2_add_result_value = ivec2_add.invoke(v, ivec2{22, 11}).value(); + const meta::value ivec2_add_result_value = ivec2_add.invoke(v, ivec2{22, 11}); // checks the type and value of the result CHECK(ivec2_add_result_value.get_type() == meta::resolve_type());