std::is_placeholder (3) - Linux Manuals
std::is_placeholder: std::is_placeholder
NAME
std::is_placeholder - std::is_placeholder
Synopsis
Defined in header <functional>
template< class T > (since C++11)
struct is_placeholder;
If T is the type of a standard placeholder (_1, _2, _3, ...), then this template is derived from std::integral_constant<int,1>, std::integral_constant<int,2>, std::integral_constant<int,3>, respectively.
If T is not a standard placeholder type, this template is derived from std::integral_constant<int,0>
The template may be specialized for any user-defined T type: the specialization must satisfy UnaryTypeTrait with BaseCharacteristic of std::integral_constant<int, N> with N > 0 to indicate that T should be treated as N'th placeholder type.
std::bind uses std::is_placeholder to detect placeholders for unbound arguments.
Helper variable template
template< class T > (since C++17)
inline constexpr int is_placeholder_v = is_placeholder<T>::value;
Inherited from std::integral_constant
Member constants
value placeholder value or 0 for non-placeholder types
[static]
Member functions
operator int (public member function)
operator() returns value
(C++14)
Member types
Type Definition
value_type int
type std::integral_constant<int, value>
Example
// Run this code
Output:
See also
bind binds one or more arguments to a function object
(C++11)
_1,__2,__3,__4,_... placeholders for the unbound arguments in a std::bind expression
(C++11)