Solaris C ++ Stream Input >> Operator and Template Templates

I have a compiler option that I could use in the CC compiler to get the following code (which compiles in Visual C ++)

std::vector<std::vector<double>> v2; 

without the following error

Error: "," is expected instead of "→"

+4
source share
3 answers

Try the following:

std::vector<std::vector<double> > v2; //give a space between two '>'

" >> " is interpreted as the right shift operator, and therefore you get a compile-time error.

This issue will be fixed in C ++ 0x. Take a look here .

+13
source

You need more space between the two characters:

 std::vector<std::vector<double> > v2; 

Otherwise, “→” is considered as one token.

+5
source
 std::vector<std::vector<double> > v2; 

You need to add a space, otherwise it will be interpreted as an operator →.

+5
source

All Articles