5.2 KiB
[func.bind.partial]
22 General utilities library [utilities]
22.10 Function objects [function.objects]
22.10.14 Function templates bind_front and bind_back [func.bind.partial]
template<class F, class... Args> constexpr unspecified bind_front(F&& f, Args&&... args); template<class F, class... Args> constexpr unspecified bind_back(F&& f, Args&&... args);
Within this subclause:
g is a value of the result of a bind_front or bind_back invocation,
FD is the type decay_t,
fd is the target object of g ([func.def]) of type FD, direct-non-list-initialized with std::forward<F>(f),
BoundArgs is a pack that denotes decay_t...,
bound_args is a pack of bound argument entities of g ([func.def]) of types BoundArgs..., direct-non-list-initialized with std::forward(args)..., respectively, and
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 &&(is_constructible_v<BoundArgs, Args> && ...) &&(is_move_constructible_v && ...) is true.
Preconditions: FD meets the Cpp17MoveConstructible requirements.
For each Ti in BoundArgs, if Ti is an object type,Ti meets the Cpp17MoveConstructible requirements.
Returns: A perfect forwarding call wrapper ([func.require]) g with call pattern:
invoke(fd, bound_args..., call_args...) for a bind_front invocation, or
invoke(fd, call_args..., bound_args...) for a bind_back invocation.
Throws: Any exception thrown by the initialization of the state entities of g ([func.def]).
template<auto f, class... Args> constexpr unspecified bind_front(Args&&... args); template<auto f, class... Args> constexpr unspecified bind_back(Args&&... args);
Within this subclause:
F is the type of f,
g is a value of the result of a bind_front or bind_back invocation,
BoundArgs is a pack that denotes decay_t...,
bound_args is a pack of bound argument entities ofg ([func.def]) of types BoundArgs..., direct-non-list-initialized with std::forward(args)..., respectively, and
call_args is an argument pack used in a function call expression ([expr.call]) of g.
Mandates:
(is_constructible_v<BoundArgs, Args> && ...) is true, and
(is_move_constructible_v && ...) is true, and
if is_pointer_v || is_member_pointer_v is true, then f != nullptr is true.
Preconditions: For each Ti in BoundArgs,Ti meets the Cpp17MoveConstructible requirements.
Returns: A perfect forwarding call wrapper ([func.require]) g that does not have a target object, and has the call pattern:
invoke(f, bound_args..., call_args...) for a bind_front invocation, or
invoke(f, call_args..., bound_args...) for a bind_back invocation.
Throws: Any exception thrown by the initialization of bound_args.