In Boost there are some convenient functions that let you fill up a container in a single line.
For example, list_of lets you fill a list like so.
#include <boost/assign/list_of.hpp> // for 'list_of()'
#include <list>
std::list<int> primes = boost::assign::list_of(2)(3)(5)(7)(11);
On my project I’m using Qt and cannot use Boost. Is there a similarly convenient way for filling up Qt’s containers at the point of construction?
You can use QList::operator<<