CARVIEW |
Select Language
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 19 Jul 2025 19:17:45 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
ETag: W/"b94e-Pse+UADHx3KskwiAyMRQDivC3sA"
Content-Encoding: gzip
Function objects are objects specifically designed to be used with a syntax similar to that of functions. In C++, this is achieved by defining member function
They are typically used as arguments to functions, such as predicates or comparison functions passed to standard algorithms.
Comparison operations:
Logical operations:
Parameter binders
Conversors
Reference
C library:
- <cassert> (assert.h)
- <cctype> (ctype.h)
- <cerrno> (errno.h)
-
<cfenv> (fenv.h)C++11
- <cfloat> (float.h)
-
<cinttypes> (inttypes.h)C++11
- <ciso646> (iso646.h)
- <climits> (limits.h)
- <clocale> (locale.h)
- <cmath> (math.h)
- <csetjmp> (setjmp.h)
- <csignal> (signal.h)
- <cstdarg> (stdarg.h)
-
<cstdbool> (stdbool.h)C++11
- <cstddef> (stddef.h)
-
<cstdint> (stdint.h)C++11
- <cstdio> (stdio.h)
- <cstdlib> (stdlib.h)
- <cstring> (string.h)
-
<ctgmath> (tgmath.h)C++11
- <ctime> (time.h)
-
<cuchar> (uchar.h)C++11
- <cwchar> (wchar.h)
- <cwctype> (wctype.h)
Containers:
-
<array>C++11
- <deque>
-
<forward_list>C++11
- <list>
- <map>
- <queue>
- <set>
- <stack>
-
<unordered_map>C++11
-
<unordered_set>C++11
- <vector>
-
Input/Output:
Multi-threading:
-
<atomic>C++11
-
<condition_variable>C++11
-
<future>C++11
-
<mutex>C++11
-
<thread>C++11
-
Other:
- <algorithm>
- <bitset>
-
<chrono>C++11
-
<codecvt>C++11
- <complex>
- <exception>
- <functional>
-
<initializer_list>C++11
- <iterator>
- <limits>
- <locale>
- <memory>
- <new>
- <numeric>
-
<random>C++11
-
<ratio>C++11
-
<regex>C++11
- <stdexcept>
- <string>
-
<system_error>C++11
-
<tuple>C++11
-
<type_traits>C++11
-
<typeindex>C++11
- <typeinfo>
- <utility>
- <valarray>
<functional>
functions
wrapper classes
- binary_negate
-
functionC++11
-
reference_wrapperC++11
- unary_negate
operator classes
other classes
-
bad_function_callC++11
-
hashC++11
-
is_bind_expressionC++11
-
is_placeholderC++11
-
namespaces
-
placeholdersC++11
-
deprecated
- Reference
- <functional>
header
<functional>
Function objects
operator()
in their class, like for example:
|
|
They are typically used as arguments to functions, such as predicates or comparison functions passed to standard algorithms.
Base classes
- unary_function
- Unary function object base class (class template)
- binary_function
- Binary function object base class (class template)
Operator classes
Arithmetic operations:- plus
- Addition function object class (class template)
- minus
- Subtraction function object class (class template)
- multiplies
- Multiplication function object class (class template)
- divides
- Division function object class (class template)
- modulus
- Modulus function object class (class template)
- negate
- Negative function object class (class template)
Comparison operations:
- equal_to
- Function object class for equality comparison (class template)
- not_equal_to
- Function object class for non-equality comparison (class template)
- greater
- Function object class for greater-than inequality comparison (class template)
- less
- Function object class for less-than inequality comparison (class template)
- greater_equal
- Function object class for greater-than-or-equal-to comparison (class template)
- less_equal
- Function object class for less-than-or-equal-to comparison (class template)
Logical operations:
- logical_and
- Logical AND function object class (class template)
- logical_or
- Logical OR function object class (class template)
- logical_not
- Logical NOT function object class (class template)
Adaptor and conversion functions
Negators- not1
- Return negation of unary function object (function template)
- not2
- Return negation of binary function object (function template)
Parameter binders
- bind1st
- Return function object with first parameter bound (function template)
- bind2nd
- Return function object with second parameter bound (function template)
Conversors
- ptr_fun
- Convert function pointer to function object (function template)
- mem_fun
- Convert member function to function object (pointer version) (function template)
- mem_fun_ref
- Convert member function to function object (reference version) (function template)
Instrumental types
- unary_negate
- Negate unary function object class (class template)
- binary_negate
- Negate binary function object class (class template)
- binder1st
- Generate function object class with 1st parameter bound (class template)
- binder2nd
- Generate function object class with 2nd parameter bound (class template)
- pointer_to_unary_function
- Generate unary function object class from pointer (class template)
- pointer_to_binary_function
- Generate binary function object class from pointer (class template)
- mem_fun_t
- Generate function object class from parameterless member (pointer version) (class template)
- mem_fun1_t
- Generate function object class from single-parameter member (pointer version) (class template)
- const_mem_fun_t
- Generate function object class from const parameterless member (pointer version) (class template)
- const_mem_fun1_t
- Generate function object class from single-parameter const member (pointer version) (class template)
- mem_fun_ref_t
- Generate function object class from parameterless member (reference version) (class template)
- mem_fun1_ref_t
- Generate function object class from single-parameter member (reference version) (class template)
- const_mem_fun_ref_t
- Generate function object class from const parameterless member (reference version) (class template)
- const_mem_fun1_ref_t
- Generate function object class from single-parameter const member (reference version) (class template)
Functions
These functions create objects of wrapper classes based on its arguments:- bind
- Bind function arguments (function template)
- cref
- Construct reference_wrapper to const (function template)
- mem_fn
- Convert member function to function object (function template)
- not1
- Return negation of unary function object (function template)
- not2
- Return negation of binary function object (function template)
- ref
- Construct reference_wrapper (function template)
Classes
Wrapper classes
Wrapper classes are classes that hold an object and have an interface similar to that object, but adding or changing some of its features:- binary_negate
- Negate binary function object class (class template)
- function
- Function wrapper (class template)
- reference_wrapper
- Reference wrapper (class template)
- unary_negate
- Negate unary function object class (class template)
Operator classes
Operator classes are classes that define functional objects that call operators:- bit_and
- Bitwise AND function object class (class template)
- bit_or
- Bitwise OR function object class (class template)
- bit_xor
- Bitwise XOR function object class (class template)
- divides
- Division function object class (class template)
- equal_to
- Function object class for equality comparison (class template)
- greater
- Function object class for greater-than inequality comparison (class template)
- greater_equal
- Function object class for greater-than-or-equal-to comparison (class template)
- less
- Function object class for less-than inequality comparison (class template)
- less_equal
- Function object class for less-than-or-equal-to comparison (class template)
- logical_and
- Logical AND function object class (class template)
- logical_not
- Logical NOT function object class (class template)
- logical_or
- Logical OR function object class (class template)
- minus
- Subtraction function object class (class template)
- modulus
- Modulus function object class (class template)
- multiplies
- Multiplication function object class (class template)
- negate
- Negative function object class (class template)
- not_equal_to
- Function object class for non-equality comparison (class template)
- plus
- Addition function object class (class template)
Other classes
- bad_function_call
- Exception thrown on bad call (class)
- hash
- Default hash function object class (class template)
- is_bind_expression
- Is bind expression (class template)
- is_placeholder
- Is placeholder (class template)
Namespaces
- placeholders
- Bind argument placeholders (namespace)
Home page | Privacy policy
© cplusplus.com, 2000-2025 - All rights reserved - v3.3.4s
Spotted an error? contact us
© cplusplus.com, 2000-2025 - All rights reserved - v3.3.4s
Spotted an error? contact us