mirror of
https://github.com/BlackMATov/meta.hpp.git
synced 2025-12-14 11:40:35 +07:00
get_as<T> for variable and member
This commit is contained in:
@@ -80,8 +80,8 @@ TEST_CASE("meta/meta_examples/scopes/local") {
|
||||
const meta::variable unit3_variable = math_scope.get_variable("unit3");
|
||||
|
||||
// checks and uses found variables with functions
|
||||
CHECK(unit2_variable.get().get_as<ivec2>() == ivec2{1,1});
|
||||
CHECK(unit3_variable.get().get_as<ivec3>() == ivec3{1,1,1});
|
||||
CHECK(unit2_variable.get_as<ivec2>() == ivec2{1,1});
|
||||
CHECK(unit3_variable.get_as<ivec3>() == ivec3{1,1,1});
|
||||
CHECK(dot2_function(unit2_variable.get(), unit2_variable.get()).get_as<int>() == 2);
|
||||
CHECK(dot3_function(unit3_variable.get(), unit3_variable.get()).get_as<int>() == 3);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,6 @@ TEST_CASE("meta/meta_examples/variable/usage") {
|
||||
// prints all variables in the scope
|
||||
std::cout << "* " << constants_scope.get_name() << std::endl;
|
||||
for ( auto&& [index, variable] : constants_scope.get_variables() ) {
|
||||
std::cout << " - " << index.get_name() << ":" << variable.get().get_as<double>() << std::endl;
|
||||
std::cout << " - " << index.get_name() << ":" << variable.get_as<double>() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user