< cpp | utility | functional
Some items share placeholders. For example, Amulet of Glory (4) and Amulet of Glory (2) use the same placeholder as each other. This means that if you were to withdraw your Amulet (4), leaving a placeholder, and then use a couple of charges before returning it to your bank, your Amulet (2) would go into the placeholder's slot. Welcome to the WizardsAnimalsWiki Wiki! Sub to new channel videos by: dickintheowl.com.
C++Language | ||||
Standard Library Headers | ||||
Freestanding and hosted implementations | ||||
Named requirements | ||||
Language support library | ||||
Concepts library(C++20) | ||||
Diagnostics library | ||||
Utilities library | ||||
Strings library | ||||
Containers library | ||||
Iterators library | ||||
Ranges library(C++20) | ||||
Algorithms library | ||||
Numerics library | ||||
Localizations library | ||||
Input/output library | ||||
Filesystem library(C++17) | ||||
Regular expressions library(C++11) | ||||
Atomic operations library(C++11) | ||||
Thread support library(C++11) | ||||
Technical Specifications |
![Placeholder Wizard 1 2 Placeholder Wizard 1 2](https://flylib.com/books/1/383/1/html/2/files/04inf13.jpg)
|
|
Placeholder Wizard 1 2 Full
Function objects
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Operator wrappers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Old binders and adaptors | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
/*see below*/ _1; /*see below*/ _2; /*see below*/ _N;. . |
The std::placeholders namespace contains the placeholder objects
[_1, . . . _N]
where N
is an implementation defined maximum number.When used as an argument in a std::bind expression, the placeholder objects are stored in the generated function object, and when that function object is invoked with unbound arguments, each placeholder
_N
is replaced by the corresponding Nth unbound argument.Each placeholder is declared as if by extern/*unspecified*/ _1; | (until C++17) |
Implementations are encouraged to declare the placeholders as if by inlineconstexpr/*unspecified*/ _1;, although declaring them by extern/*unspecified*/ _1; is still allowed by the standard. | (since C++17) |
The types of the placeholder objects are DefaultConstructible and CopyConstructible, their default copy/move constructors do not throw exceptions, and for any placeholder
_N
, the type std::is_placeholder<decltype(_N)> is defined and is derived from std::integral_constant<int, N>.[edit]Example
Placeholder Wizard 1 2 Download
The following code shows the creation of function objects with a placeholder argument.
Placeholder Wizard 1 2 0
Mushroom war game. Output:
[edit]See also
(C++11) | binds one or more arguments to a function object (function template)[edit] |
(C++11) | indicates that an object is a standard placeholder or can be used as one (class template)[edit] |
placeholder to skip an element when unpacking a tuple using tie(constant)[edit] |
![Placeholder Wizard 1 2 Placeholder Wizard 1 2](https://www.mediachance.com/dvdlab/helppro2/scenes3.gif)
Retrieved from 'https://en.cppreference.com/mwiki/index.php?title=cpp/utility/functional/placeholders&oldid=115147'