std::experimental::not_fn

From cppreference.com
Defined in header <experimental/functional>
template< class F>
/*unspecified*/ not_fn( F&& f );
(library fundamentals TS v2)

Creates a forwarding call wrapper that returns the complement of the callable object it holds.

Contents

[edit] Parameters

f - the object from which the Callable object held by the wrapper is constructed

[edit] Return value

Let FD be std::decay_t<F> and fd be an lvalue of type FD constructed from std::forward<F>(f).

not_fn returns a forwarding call wrapper fn of unspecified type such that fn(a1, a2, ..., aN) is equivalent to !INVOKE(fd, a1, ..., aN), where INVOKE is the operation described in Callable.

The returned call wrapper is always MoveConstructible, and is CopyConstructible if FD is CopyConstructible.

[edit] Remarks

If fd is not Callable, or std::is_constructible<FD, F>::value is not true, the behavior is undefined.

[edit] Exceptions

Throws no exceptions, unless the construction of fd throws.

[edit] Notes

not_fn is intended to replace the C++03-era negators std::not1 and std::not2.

[edit] See also

wrapper function object returning the complement of the unary predicate it holds
(class template)
wrapper function object returning the complement of the binary predicate it holds
(class template)
constructs custom std::unary_negate object
(function template)
constructs custom std::binary_negate object
(function template)