I have a code provided to me by another person who has a structure
struct Pair { string s1; string s2; bool equivalent; };
He then sets the vector of these hardcoded structures.
std::vector<Pair> PairID; staticdata() { PairID={{"string","string2",true}, {"string","string3",true}, {"string","string4",false}, {"string","string7",false}, {"string3","string8",false} }; }
Unfortunately, my compiler complains about the string PairID = {{"string", "string2", true},
Why is this? He suggested compiling with -std = C ++ 0x, but my compiler (gcc 4.2) does not support this. Is there an easy way to convert code to make it work? Why does this fail?
I use Mac OSX and prefer not to update my compiler
c ++ struct vector
Robert Nov 11 '10 at 15:10 2010-11-11 15:10
source share