Why has vector<vector<int>> been *kept* illegal?

Why has vector<vector<int>> been *kept* illegal?

The rationale stems from a basic principle of C++ (and C) parsing
known as the "maximum munch" rule. It says that the longest
sequence of characters that can make a valid token is always
the next token. Thus ">>" always wins out over ">" ">".

Having said that, I must report that the C++ committee seems to
have solved this annoying problem last month in Lillehammer. The
next revision of C++ will indeed accept "vector<vector<int>>"
with the meaning we all want.

P.J. Plauger
Dinkumware, Ltd.
http://www.yqcomputer.com/

---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.yqcomputer.com/ ]

What would be the most effective way to convert vector<pair<int,int> >
to pair<vector<int>,vector<int> >?

I know I can do it as follows:

struct split : unary_function<void, pair<int,int> >
{
pair<vector<int>,vector<int> > a;
void operator()(pair<int,int> p) { a.first.push_back(p.first);
a.second.push_back(p.second); }
};

...
vector<pair<int,int> > p;
for (int i = 0; i < 100; i++)
p.push_back(pair<int,int>(i,2*i));

split s = for_each(p.begin(), p.end(), split());
...

But I'm not very satisfied with that solution. It seems that I'll
need to have 3 vectors at the end of the day, 1 of the original, and 2
afterwards.

Is there a better way?

(fyi: I'm trying to write an app for audio data that will split the
interleaved stereo channels into seperate right and left channels.)