Chapter 7. The mem_fn
Function Template
The conditionings associated with a particular class …produce habitus, structured structures predisposed to function as structuring structures ….
— The Logic of PracticePIERRE BOURDIEU, TRANSLATED BY RICHARD NICE
template <class Ret, class Ty> unspecified mem_fn(Ret Ty::*pm);
The function template returns a simple call wrapper cw
, with a weak result type (see Section 6.2), such that the expression cw(a1, a2, …, aN)
is equivalent to INVOKE (pm, a1, a2, …, aN)
(see Section 6.2).
The returned call wrapper is derived from std::unary_function<cv Ty*, Ret>
—hence defining the nested type result_type
as a synonym for Ret
and the nested type argument_type
as a synonym for cv Ty*
— only if the type Ty
is a pointer ...
Get The C++ Standard Library Extensions A Tutorial and Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.