22 General utilities library [utilities]

22.10 Function objects [function.objects]

22.10.13 Function template not_fn [func.not.fn]

template<class F> constexpr unspecified not_fn(F&& f);
In the text that follows:
  • g is a value of the result of a not_fn invocation,
  • FD is the type decay_t<F>,
  • fd is the target object of g ([func.def]) of type FD, direct-non-list-initialized with std​::​forward<F​>(f),
  • call_args is an argument pack used in a function call expression ([expr.call]) of g.
Mandates: is_constructible_v<FD, F> && is_move_constructible_v<FD> is true.
Preconditions: FD meets the Cpp17MoveConstructible requirements.
Returns: A perfect forwarding call wrapper ([func.require]) g with call pattern !invoke(fd, call_args...).
Throws: Any exception thrown by the initialization of fd.
template<auto f> constexpr unspecified not_fn() noexcept;
In the text that follows:
  • F is the type of f,
  • g is a value of the result of a not_fn invocation,
  • call_args is an argument pack used in a function call expression ([expr.call]) of g.
Mandates: If is_pointer_v<F> || is_member_pointer_v<F> is true, then f != nullptr is true.
Returns: A perfect forwarding call wrapper ([func.require]) g that does not have state entities, and has the call pattern !invoke(f, call_args...).