Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>it appears, <a href="http://en.cppreference.com/w/cpp/types/is_member_function_pointer" rel="nofollow">via this link</a>, that the following implmentation is used for is_member_function_pointer</p> <pre><code>template&lt; class T &gt; struct is_member_function_pointer_helper : std::false_type {}; template&lt; class T, class U&gt; struct is_member_function_pointer_helper&lt;T U::*&gt; : std::is_function&lt;T&gt; {}; template&lt; class T &gt; struct is_member_function_pointer : is_member_function_pointer_helper&lt; typename std::remove_cv&lt;T&gt;::type &gt; {}; </code></pre> <p>So you can determine if something is a member pointer for something of type U using the T U::* and you can determine if T is a function type. I don't know of any syntax for a member function type, only a member function pointer type. I'd have to consult the standard to see if such a type can exist.</p> <p>If it is the case that this does not exist you could implement a wrapper class which added the pointer for you like so.</p> <pre><code>template&lt;class T&gt; struct is_member_function { static const bool value = std::is_member_function_pointer&lt;T*&gt;::value; }; </code></pre> <p>But when I try decltype(some_type::some_member) I get an error saying I can't just use some_type::some_member. a '&amp;' is required</p> <p>The following works for function member pointers</p> <pre><code>std::is_member_function_pointer&lt;decltype(&amp;foo::hello)&gt;::value </code></pre> <p>It seems to me that you can only use member pointers and not just member types.</p> <p>an alternate implementation of the above is_member_function_pointer_helper might look like</p> <pre><code>template&lt;class... Args, class R, class U&gt; struct is_member_function_pointer_helper&lt;R (U::*)(Args...)&gt; : std::true_type {}; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload