I have a container that has no push_back() method. But this container has an iterator on begin()and end().
I would like to use std::transform() to output into that container. But std::back_inserter needs to call push_back() on the output container.
Is it possible to use std::transform() to output into a container that just supports direct assignment? Like:
for (auto item : containerNoPushBack)
{
item = calculateValue();
}
Or indexed assignment like:
for (size_t i = 0; i < containerNoPushBack.size(); ++i)
{
item[i] = calculateValue();
}