std::function::function
提供:cppreference.com
< cpp | utility | functional | function
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| function(); |
(1) | (C + + 11以来) |
| function( std::nullptr_t ); |
(2) | (C + + 11以来) |
| function( const function& f ); |
(3) | (C + + 11以来) |
| function( function&& f ); |
(4) | (C + + 11以来) |
| template< class F > function( F f ); |
(5) | (C + + 11以来) |
| template< class Alloc > function( std::allocator_arg_t, const Alloc& alloc ); |
(6) | (C + + 11以来) |
| template< class Alloc > function( std::allocator_arg_t, const Alloc& alloc, |
(7) | (C + + 11以来) |
| template< class Alloc > function( std::allocator_arg_t, const Alloc& alloc, |
(8) | (C + + 11以来) |
| template< class Alloc > function( std::allocator_arg_t, const Alloc& alloc, |
(9) | (C + + 11以来) |
| template< class F, class Alloc > function( std::allocator_arg_t, const Alloc& alloc, F f ); |
(10) | (C + + 11以来) |
さまざまなソースからの
std::functionを構築し.Original:
Constructs a
std::function from a variety of sources.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
@ 1、2、7 @空の関数を作成します.
Original:
@1, 2, 7@ Create an empty function.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
@ 3,8 @
fのコピーを作成します.Original:
@3, 8@ Create a copy of
f.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
@ 4,9 @
fに*thisの内容を移動.Original:
@4, 9@ Move the contents of
f into *this.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
@ 5、10 @
Callablefに*thisオブジェクトを移動.Original:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集] パラメータ
| f | - | *thisを初期化するために使用する関数オブジェクト
Original: the function object used to initialize *this The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| alloc | - | 内部メモリ割り当てに使用
Allocator Original: an Allocator used for internal memory allocation The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[編集] ノート
6-10)タイプstd::allocator_arg_tの最初のパラメータを持っているコンストラクタは
allocあるタイプAの第2引数Allocatorを持っている必要があります。このアロケータはfunctionが使用する可能性のあるすべての内部データ構造にメモリを作成するために使用され.Original:
Constructors that have a first parameter of type std::allocator_arg_t must have a second argument
alloc of type A that is an Allocator. This allocator is used to create memory for any internal data structures that the function might use.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
5、10)タイプ
FはCopyConstructibleであるべきであり、オブジェクトfはCallableでなければなりません。 fがNULL関数ポインタ、メンバへのNULLポインターの場合、またはf場合はstd::functionあると!f == trueた場合に作成された関数オブジェクトは空になります。引数fは、得られた関数オブジェクトに移動されます.Original:
5, 10) The type
F should be CopyConstructible and the object f should be Callable. The resulting function object that is created will be empty if f is a NULL function pointer, a NULL pointer to member, or if f is a std::function and !f == true. The argument f is moved into the resulting function object.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] 例外
1-2) 3-5)(なし)
6-7)
8-10) Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
(なし)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] 例
| This section is incomplete Reason: no example |