Using STL/Boost to initialize a hard-coded set<vector<int> >
Posted
by Hooked
on Stack Overflow
See other posts from Stack Overflow
or by Hooked
Published on 2010-04-30T05:50:46Z
Indexed on
2010/04/30
5:57 UTC
Read the original article
Hit count: 468
Like this question already asked, I'd like to initialize a container using STL where the elements are hard-coded in the cleanest manner possible. In this case, the elements are a doubly nested container:
set<vector<int> > A;
And I'd like (for example) to put the following values in:
A = [[0,0,1],[0,1,0],[1,0,0],[0,0,0]];
C++0x fine, using g++
4.4.1. STL is preferable as I don't use Boost for any other parts of the code (though I wouldn't mind an example with it!).
© Stack Overflow or respective owner