[func.not.fn]

# 22 General utilities library [[utilities]](./#utilities)

## 22.10 Function objects [[function.objects]](function.objects#func.not.fn)

### 22.10.13 Function template not_fn [func.not.fn]

[ð](#lib:not_fn)

`template<class F> constexpr unspecified not_fn(F&& f);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L13133)

In the text that follows:

- [(1.1)](#1.1)

g is a value of the result of a not_fn invocation,

- [(1.2)](#1.2)

FD is the type decay_t<F>,

- [(1.3)](#1.3)

fd is the target object of g ([[func.def]](func.def "22.10.3 Definitions"))
 of type FD,
 direct-non-list-initialized with std​::​forward<F​>(f),

- [(1.4)](#1.4)

call_args is an argument pack
 used in a function call expression ([[expr.call]](expr.call "7.6.1.3 Function call")) of g[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L13145)

*Mandates*: is_constructible_v<FD, F> && is_move_constructible_v<FD> is true[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L13150)

*Preconditions*: FD meets the [*Cpp17MoveConstructible*](utility.arg.requirements#:Cpp17MoveConstructible "16.4.4.2 Template argument requirements [utility.arg.requirements]") requirements[.](#3.sentence-1)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L13154)

*Returns*: A perfect forwarding call wrapper ([[func.require]](func.require#term.perfect.forwarding.call.wrapper "22.10.4 Requirements")) g with call pattern !invoke(fd, call_args...)[.](#4.sentence-1)

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L13159)

*Throws*: Any exception thrown by the initialization of fd[.](#5.sentence-1)

[ð](#lib:not_fn_)

`template<auto f> constexpr unspecified not_fn() noexcept;
`

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L13170)

In the text that follows:

- [(6.1)](#6.1)

F is the type of f,

- [(6.2)](#6.2)

g is a value of the result of a not_fn invocation,

- [(6.3)](#6.3)

call_args is an argument pack
used in a function call expression ([[expr.call]](expr.call "7.6.1.3 Function call")) of g[.](#6.sentence-1)

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L13182)

*Mandates*: If is_pointer_v<F> || is_member_pointer_v<F> is true,
then f != nullptr is true[.](#7.sentence-1)

[8](#8)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L13187)

*Returns*: A perfect forwarding call wrapper ([[func.require]](func.require "22.10.4 Requirements")) g that
does not have state entities, and
has the call pattern !invoke(f, call_args...)[.](#8.sentence-1)
