Difference between revisions of "Template:cpp/container/emplace back"
From cppreference.com
(s/insert/appends for consistency with push_back) |
|||
Line 20: | Line 20: | ||
===Complexity=== | ===Complexity=== | ||
Constant. | Constant. | ||
+ | |||
+ | ===Example=== | ||
+ | |||
+ | {{eq fun cpp | 1 = | ||
+ | typedef std::tuple<std::string, std::String, int> President; | ||
+ | std::{{{1}}}<president> v; | ||
+ | v.emplace_back("Franklin Delano", "Roosevelt", 1932); | ||
+ | |||
+ | }} | ||
===See also=== | ===See also=== |
Revision as of 05:32, 28 November 2011
Template:cpp/container//sidebar
template< class... Args > void emplace_back( Args&&... args ); |
Template:mark c++11 feature | |
Appends a new element to the end of the container. The element is constructed in-place, i.e. no copy or move operations are performed. The constructor of the element is called with exactly the same arguments, as supplied to the function.
Contents |
Parameters
args | - | arguments to forward to the constructor of the element |
Return value
(none)
Complexity
Constant.