I want to construct an std::vector
with some elements having these elements constructed by some particular constructor rather than the default constructor. In other words I want to emplace the elements while constructing the vector. How can I do that?
Consider this:
struct Item
{
Item(double) {}
Item(const Item&) = delete;
Item(Item&&) = delete;
};
std::vector<Item> vv(10, 3.14); // Fails! Tries to copy while I want to emplace.