Files
cppdraft_translate/cppdraft/func/bind/isbind.md
2025-10-25 03:02:53 +03:00

36 lines
1.5 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[func.bind.isbind]
# 22 General utilities library [[utilities]](./#utilities)
## 22.10 Function objects [[function.objects]](function.objects#func.bind.isbind)
### 22.10.15 Function object binders [[func.bind]](func.bind#isbind)
#### 22.10.15.2 Class template is_bind_expression [func.bind.isbind]
[🔗](#lib:is_bind_expression)
namespace std {template<class T> struct is_bind_expression; // see below}
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L13345)
The class template is_bind_expression can be used to detect function objects
generated by bind[.](#1.sentence-1)
The function template bind uses is_bind_expression to detect subexpressions[.](#1.sentence-2)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L13350)
Specializations of the is_bind_expression template shall meet
the [*Cpp17UnaryTypeTrait*](meta.rqmts#:Cpp17UnaryTypeTrait "21.3.2Requirements[meta.rqmts]") requirements ([[meta.rqmts]](meta.rqmts "21.3.2Requirements"))[.](#2.sentence-1)
The implementation
provides a definition that has a base characteristic oftrue_type if T is a type returned from bind,
otherwise it has a base characteristic of false_type[.](#2.sentence-2)
A program may specialize this template for a program-defined type T to have a base characteristic of true_type to indicate thatT should be treated as a subexpression in a bind call[.](#2.sentence-3)