I have come across this code snippet in C++:
template <typename T, typename V>
static void Check(V(T::*getter)(), identity_t<void(T::*)(V)>::type setter);
You can see it in the comment section of this post:
Template deduction from pointer-to-members, where at least one pointer-to-member is known
I have also seen similar snippets which look like this:
identity_t<void(some::input)>
I can't understand this syntax. Is identity_t
taking in a function pointer of type void
? What would the definition of identity_t
look like?