---
name: "std::function.h"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::function.h"
---

# std::function.h(3cxx)

## NAME

std\_function.h

## SYNOPSIS

### Classes

struct **std::\_\_is\_location\_invariant\< \_Tp \>**\
 class **std::\_Function\_base**\
 Base class of all polymorphic function object wrappers.  class **std::bad\_function\_call**\
 Exception class thrown when class template function's operator() is called with an empty target.  class **std::function\< \_Res(\_ArgTypes...)\>**\
 Polymorphic function wrapper.

### Namespaces

namespace **std**\
 ISO C++ entities toplevel namespace is std.  namespace **std::\_\_detail**\
 Implementation details not part of the namespace std interface.

### Enumerations

enum **\_Manager\_operation** { **\_\_get\_type\_info**, **\_\_get\_functor\_ptr**, **\_\_clone\_functor**, **\_\_destroy\_functor** }\

### Functions

template\<**typename** \_Functor , **typename** **\_Signature**  = typename \_\_function\_guide\_helper\<decltype(&\_Functor::operator())\>::type\> **std::function** (\_Functor) -\> function\< **\_Signature** \>\
 template\<**typename** **\_Res** , typename... \_ArgTypes\> **std::function** (**\_Res**(\*)(\_ArgTypes...)) -\> function\< **\_Res**(\_ArgTypes...)\>\
 template\<**typename** **\_Res** , typename... \_Args\> bool **std::operator==** (const function\< **\_Res**(\_Args...)\> &\_\_f, nullptr\_t) noexcept\
 Test whether a polymorphic function object wrapper is empty.  template\<**typename** **\_Res** , typename... \_Args\> **void** **std::swap** (function\< **\_Res**(\_Args...)\> &\_\_x, function\< **\_Res**(\_Args...)\> &\_\_y) noexcept\
 Swap the targets of two polymorphic function object wrappers.

## Detailed Description

This is an internal header file, included by other library headers. Do not attempt to use it directly. Instead, include \<functional\>.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
