Udostępnij za pośrednictwem


vector::emplace_back

Dodaje element skonstruowane w celu zakończenia wektora.

template <class... Types>
    void emplace_back(
        Types&&... _Args);

Parametry

Parametr

Opis

_Args

Argumenty konstruktora.Funkcji ustala które przeciążenie konstruktora wywoływanie oparte na podanych argumentów.

Przykład

#include <vector>
struct obj
{
   obj(int, double) {}
};

int main()
{
   std::vector<obj> v;
   v.emplace_back(1, 3.14); // obj in created in place in the vector
}

Wymagania

Nagłówek: <vector>

Obszar nazw: std

Zobacz też

Informacje

vector Class

Standardowa biblioteka szablonu