From 163b59390c32745f95838b121be3ef5e2cf08e8c Mon Sep 17 00:00:00 2001 From: Merry Date: Tue, 10 Aug 2021 12:30:46 +0100 Subject: [PATCH] Squashed 'externals/mp/' changes from 649fde1e..b50053ce b50053ce function_info: Implement equivalent_function_type_with_class git-subtree-dir: externals/mp git-subtree-split: b50053cef50385419c59fb3aebb78974547318bc --- README.md | 1 + include/mp/traits/function_info.h | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 21617870..58529461 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,7 @@ Type traits not in the standard library. * `mp::parameter_list`: Get a typelist of the parameter types * `mp::get_parameter`: Get the type of a parameter by index * `mp::equivalent_function_type`: Get an equivalent function type (for MFPs this does not include the class) +* `mp::equivalent_function_type_with_class`: Get an equivalent function type with explicit `this` argument (MFPs only) * `mp::return_type`: Return type of the function * `mp::class_type`: Only valid for member function pointer types. Gets the class the member function is associated with. diff --git a/include/mp/traits/function_info.h b/include/mp/traits/function_info.h index 7f5a9dbf..85dc9a91 100644 --- a/include/mp/traits/function_info.h +++ b/include/mp/traits/function_info.h @@ -36,11 +36,15 @@ struct function_info : function_info {}; template struct function_info : function_info { using class_type = C; + + using equivalent_function_type_with_class = R(C*, As...); }; template struct function_info : function_info { using class_type = C; + + using equivalent_function_type_with_class = R(C*, As...); }; template @@ -55,6 +59,9 @@ using get_parameter = typename function_info::template parameter::type; template using equivalent_function_type = typename function_info::equivalent_function_type; +template +using equivalent_function_type_with_class = typename function_info::equivalent_function_type_with_class; + template using return_type = typename function_info::return_type;