|
|
@@ -12,44 +12,62 @@ struct test_obj |
|
|
|
static std::string sget(); |
|
|
|
}; |
|
|
|
|
|
|
|
constexpr decltype(auto) cpp_traits_lambda = [](std::string, int)->bool { return true; }; |
|
|
|
const test_obj& static_fuu() |
|
|
|
{ |
|
|
|
static const test_obj value; |
|
|
|
return value; |
|
|
|
} |
|
|
|
|
|
|
|
decltype(auto) cpp_traits_lambda = [](std::string, int)->bool { return true; }; |
|
|
|
|
|
|
|
using type0 = ::cppmp::lambda_traits<decltype(&test_obj::test)>; |
|
|
|
using type1 = ::cppmp::lambda_traits<decltype(&test_obj::ctest)>; |
|
|
|
using type2 = ::cppmp::lambda_traits<decltype(&test_obj::sget)>; |
|
|
|
using type3 = ::cppmp::lambda_traits<std::string(*)(bool)>; |
|
|
|
using type4 = ::cppmp::lambda_traits<decltype(cpp_traits_lambda)>; |
|
|
|
using type5 = ::cppmp::lambda_traits<decltype(&static_fuu)>; |
|
|
|
|
|
|
|
static_assert(is_same_v<typename type0::object_type, test_obj>, ""); |
|
|
|
static_assert(is_same_v<typename type0::return_type, int>, ""); |
|
|
|
static_assert(is_same_v<typename type0::arguments_type, std::tuple<int>>, ""); |
|
|
|
static_assert( type0::is_mutable_v == true, ""); |
|
|
|
static_assert( type0::is_static_v == false, ""); |
|
|
|
static_assert( type0::argument_count_v == 1, ""); |
|
|
|
|
|
|
|
static_assert(is_same_v<typename type1::object_type, test_obj>, ""); |
|
|
|
static_assert(is_same_v<typename type1::return_type, double>, ""); |
|
|
|
static_assert(is_same_v<typename type1::arguments_type, std::tuple<float, std::string>>, ""); |
|
|
|
static_assert( type1::is_mutable_v == false, ""); |
|
|
|
static_assert( type1::is_static_v == false, ""); |
|
|
|
static_assert( type1::argument_count_v == 2, ""); |
|
|
|
|
|
|
|
static_assert(is_same_v<typename type2::object_type, void>, ""); |
|
|
|
static_assert(is_same_v<typename type2::return_type, std::string>, ""); |
|
|
|
static_assert(is_same_v<typename type2::arguments_type, std::tuple<>>, ""); |
|
|
|
static_assert( type2::is_mutable_v == false, ""); |
|
|
|
static_assert( type2::is_static_v == true, ""); |
|
|
|
static_assert( type2::argument_count_v == 0, ""); |
|
|
|
|
|
|
|
static_assert(is_same_v<typename type0::object_type, test_obj>); |
|
|
|
static_assert(is_same_v<typename type0::return_type, int>); |
|
|
|
static_assert(is_same_v<typename type0::arguments_type, std::tuple<int>>); |
|
|
|
static_assert( type0::is_mutable_v == true); |
|
|
|
static_assert( type0::is_static_v == false); |
|
|
|
static_assert( type0::argument_count_v == 1); |
|
|
|
|
|
|
|
static_assert(is_same_v<typename type1::object_type, test_obj>); |
|
|
|
static_assert(is_same_v<typename type1::return_type, double>); |
|
|
|
static_assert(is_same_v<typename type1::arguments_type, std::tuple<float, std::string>>); |
|
|
|
static_assert( type1::is_mutable_v == false); |
|
|
|
static_assert( type1::is_static_v == false); |
|
|
|
static_assert( type1::argument_count_v == 2); |
|
|
|
|
|
|
|
static_assert(is_same_v<typename type2::object_type, void>); |
|
|
|
static_assert(is_same_v<typename type2::return_type, std::string>); |
|
|
|
static_assert(is_same_v<typename type2::arguments_type, std::tuple<>>); |
|
|
|
static_assert( type2::is_mutable_v == false); |
|
|
|
static_assert( type2::is_static_v == true); |
|
|
|
static_assert( type2::argument_count_v == 0); |
|
|
|
|
|
|
|
static_assert(is_same_v<typename type3::object_type, void>); |
|
|
|
static_assert(is_same_v<typename type3::return_type, std::string>); |
|
|
|
static_assert(is_same_v<typename type3::arguments_type, std::tuple<bool>>); |
|
|
|
static_assert( type3::is_mutable_v == false); |
|
|
|
static_assert( type3::is_static_v == true); |
|
|
|
static_assert( type3::argument_count_v == 1); |
|
|
|
|
|
|
|
static_assert(is_same_v<typename type4::return_type, bool>); |
|
|
|
static_assert(is_same_v<typename type4::arguments_type, std::tuple<std::string, int>>); |
|
|
|
static_assert( type4::is_mutable_v == false); |
|
|
|
static_assert( type4::is_static_v == false); |
|
|
|
static_assert( type4::argument_count_v == 2); |
|
|
|
static_assert(is_same_v<typename type3::object_type, void>, ""); |
|
|
|
static_assert(is_same_v<typename type3::return_type, std::string>, ""); |
|
|
|
static_assert(is_same_v<typename type3::arguments_type, std::tuple<bool>>, ""); |
|
|
|
static_assert( type3::is_mutable_v == false, ""); |
|
|
|
static_assert( type3::is_static_v == true, ""); |
|
|
|
static_assert( type3::argument_count_v == 1, ""); |
|
|
|
|
|
|
|
static_assert(is_same_v<typename type4::return_type, bool>, ""); |
|
|
|
static_assert(is_same_v<typename type4::arguments_type, std::tuple<std::string, int>>, ""); |
|
|
|
static_assert( type4::is_mutable_v == false, ""); |
|
|
|
static_assert( type4::is_static_v == false, ""); |
|
|
|
static_assert( type4::argument_count_v == 2, ""); |
|
|
|
|
|
|
|
static_assert(is_same_v<typename type5::return_type, const test_obj&>, ""); |
|
|
|
static_assert(is_same_v<typename type5::arguments_type, std::tuple<>>, ""); |
|
|
|
static_assert( type5::is_mutable_v == false, ""); |
|
|
|
static_assert( type5::is_static_v == true, ""); |
|
|
|
static_assert( type5::argument_count_v == 0, ""); |
|
|
|
|
|
|
|
TEST(cppmp_traits_test, dummy) |
|
|
|
{ |
|
|
|
(void)cpp_traits_lambda; |
|
|
|
} |