It depends.
You can do things like this
QVector<int> vec = QVector<int>() << 1 << 2;
QSet<int> set = QSet<int>() << 1 << 2;
QVector<int> vec = QVector<int>() << 1 << 2;
QSet<int> set = QSet<int>() << 1 << 2;
To copy to clipboard, switch view to plain text mode
or
typedef QVector<int> IntVector;
typdef QSet<int> IntSet;
IntSet vec = IntVector() << 1 << 2;
IntSet set = IntSet() << 1 << 2;
typedef QVector<int> IntVector;
typdef QSet<int> IntSet;
IntSet vec = IntVector() << 1 << 2;
IntSet set = IntSet() << 1 << 2;
To copy to clipboard, switch view to plain text mode
with C++11 even
auto vec = IntVector() << 1 << 2;
auto set = IntSet() << 1 << 2;
auto vec = IntVector() << 1 << 2;
auto set = IntSet() << 1 << 2;
To copy to clipboard, switch view to plain text mode
maybe even
auto vec = IntVector{ 1, 2 };
auto set = IntSet{ 1, 2 };
auto vec = IntVector{ 1, 2 };
auto set = IntSet{ 1, 2 };
To copy to clipboard, switch view to plain text mode
Cheers,
_
Bookmarks