MSVCRT std::vector 新しいページはコチラ
提供: yonewiki
(→メンバ関数 emplace_back) |
(→メンバ関数 emplace_back) |
||
78行: | 78行: | ||
=== '''メンバ関数 emplace_back''' === | === '''メンバ関数 emplace_back''' === | ||
*<span style = "background:linear-gradient(transparent 75%, #cab8d9 75%); font-weight:bold; "><span style="color:deeppink;">void</span> <span style="color:blue;">obj.emplace_back</span>(<span style="color:deeppink;">TypeTemplate(vector<TypeTemplate>&&...)</span>);</span> | *<span style = "background:linear-gradient(transparent 75%, #cab8d9 75%); font-weight:bold; "><span style="color:deeppink;">void</span> <span style="color:blue;">obj.emplace_back</span>(<span style="color:deeppink;">TypeTemplate(vector<TypeTemplate>&&...)</span>);</span> | ||
− | *<span style = "background:linear-gradient(transparent 75%, #cab8d9 75%); font-weight:bold; "><span style="color:deeppink;"> | + | *<span style = "background:linear-gradient(transparent 75%, #cab8d9 75%); font-weight:bold; "><span style="color:deeppink;">TypeTemplate&(refference_InsertValue)</span> <span style="color:blue;">obj.emplace_back</span>(<span style="color:deeppink;">TypeTemplate(vector<TypeTemplate>&&...)</span>);</span> |
− | + | ||
TypeTemplate(vector<TypeTemplate>)はvectorの型テンプレートで型を生成するコンストラクタによって初期化形式である必要があります。?何を言っているの? | TypeTemplate(vector<TypeTemplate>)はvectorの型テンプレートで型を生成するコンストラクタによって初期化形式である必要があります。?何を言っているの? | ||
97行: | 96行: | ||
} | } | ||
</syntaxhighlight2> | </syntaxhighlight2> | ||
+ | |||
+ | ※C++17以降は2つ目に書いたように TypeTemplate& のような挿入したデータへの参照を返却され、受け取ることができます。 | ||
+ | |||
+ | |||
[[[Windows#MSVC Runtimeリファレンス|MSVC Runtimeリファレンス]]に戻る | [[[Windows#MSVC Runtimeリファレンス|MSVC Runtimeリファレンス]]に戻る |