diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-12-08 20:11:35 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-12-08 20:11:35 +0900 |
commit | 95d4df58b39962f771885a6615efe1a682aab356 (patch) | |
tree | 7184234e97f1ad56ce6c5c830a775bbbb9d89621 /lib/util.h | |
parent | 3489b77bba1b9429925dfe9539c2a9e8137fc622 (diff) | |
download | libquotient-95d4df58b39962f771885a6615efe1a682aab356.tar.gz libquotient-95d4df58b39962f771885a6615efe1a682aab356.zip |
function_traits: more tests, fix function objects/lambdas not working with some compilers
A member function reference is not the same as a member function pointer.
Diffstat (limited to 'lib/util.h')
-rw-r--r-- | lib/util.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -149,8 +149,8 @@ namespace QMatrixClient { static constexpr auto is_callable = true; using return_type = ReturnT; - using arg_types = std::tuple<ArgTs..., void>; - static constexpr auto arg_number = std::tuple_size<arg_types>::value - 1; + using arg_types = std::tuple<ArgTs...>; + static constexpr auto arg_number = std::tuple_size<arg_types>::value; }; namespace _impl { @@ -161,8 +161,8 @@ namespace QMatrixClient }; template <typename T> - struct fn_traits<decltype(void(T::operator())), T> - : public fn_traits<void, decltype(T::operator())> + struct fn_traits<decltype(void(&T::operator())), T> + : public fn_traits<void, decltype(&T::operator())> { }; // A generic function object that has (non-overloaded) operator() // Specialisation for a member function |