名前空間
変種
操作

std::is_placeholder

提供: cppreference.com
< cpp‎ | utility‎ | functional

 
 
ユーティリティライブラリ
支援を入力します (basic types, RTTI, type traits)
動的なメモリ管理
エラー処理
プログラムユーティリティ
可変個引数関数
日付と時刻
関数オブジェクト
initializer_list(C++11)
bitset
hash(C++11)
関係演算子
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
ペアとタプル
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
フォワード、スワップ、および移動
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
関数オブジェクト
関数ラッパー
Original:
Function wrappers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
function(C++11)
mem_fn(C++11)
bad_function_call(C++11)
バインド
Original:
Bind
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bind(C++11)
is_bind_expression(C++11)
is_placeholder(C++11)
_1, _2, _3, ...(C++11)
リファレンス·ラッパー
Original:
Reference wrappers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
reference_wrapper(C++11)
ref
cref
(C++11)
(C++11)
オペレーターのラッパー
Original:
Operator wrappers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
否定子
Original:
Negators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
バインダーおよびアダプタは非推奨になりました
Original:
Deprecated binders and adaptors
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unary_function(廃止予定)
binary_function(廃止予定)
ptr_fun(廃止予定)
pointer_to_unary_function(廃止予定)
pointer_to_binary_function(廃止予定)
mem_fun(廃止予定)
mem_fun_t
mem_fun1_t
const_mem_fun_t
const_mem_fun1_t
(廃止予定)
(廃止予定)
(廃止予定)
(廃止予定)
mem_fun_ref(廃止予定)
mem_fun_ref_t
mem_fun1_ref_t
const_mem_fun_ref_t
const_mem_fun1_ref_t
(廃止予定)
(廃止予定)
(廃止予定)
(廃止予定)
binder1st
binder2nd
(廃止予定)
(廃止予定)
bind1st
bind2nd
(廃止予定)
(廃止予定)
 
Defined in header <functional>
template< class T >
struct is_placeholder;
(C + + 11以来)
Tは、標準的なプレースホルダ(_1、_2、_3、...)のタイプである場合、このテンプレートはstd::integral_constant<int,1>std::integral_constant<int,2>std::integral_constant<int,3>、それぞれから派生しています。 Tは、標準的なプレースホルダ型でない場合は、このテンプレートをstd::integral_constant<int,0>から導出され.
Original:
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 text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
テンプレートは、それが結合していない引数のプレースホルダであるかのようにstd::bindによって扱われるべきであるすべてのユーザー定義型に特化することができる.
Original:
The template may be specialized for any user-defined type which should be treated by std::bind as if it was a placeholder for unbound arguments.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

Inherited from std::integral_constant

Member constants

value
[静的]
placeholder value or 0 for non-placeholder types
(公共の静的メンバ定数)

Member functions

operator int
intにオブジェクトは、value返しに変換します
Original:
converts the object to int, returns value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)

Member types

タイプ
Original:
Type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
value_type int
type std::integral_constant<int, value>

[編集]

#include <iostream>
#include <type_traits>
#include <functional>
 
struct My_2 {
} my_2;
 
namespace std {
    template<>
    struct is_placeholder<My_2> : public integral_constant<int, 2> {};
}
 
int f(int n1, int n2)
{
    return n1+n2;
}
 
int main()
{
    std::cout << "Standard placeholder _5 is for the argument number "
              << std::is_placeholder<decltype(std::placeholders::_5)>::value
              << '\n';
 
    auto b = std::bind(f, my_2, 2);
    std::cout << "Adding 2 to 11 selected with a custom placeholder gives " 
              << b(10, 11) 
              << '\n';
}

Output:

Standard placeholder _5 is for the argument number 5
Adding 2 to 11 selected with a custom placeholder gives 13

[編集] も参照してください

(C++11)
関数オブジェクトに1つ以上の引数をバインドします
Original:
binds one or more arguments to a function object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数テンプレート) [edit]
std::bind式での非バインド引数のプレースホルダ
Original:
placeholders for the unbound arguments in a std::bind expression
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(定数) [edit]