|
From: K. F. <kfr...@gm...> - 2010-12-27 22:03:39
|
Hi Antoni -
On Mon, Dec 27, 2010 at 3:59 PM, Antoni Jaume <a2...@gm...> wrote:
> Code (init_vvp.cpp):
>>
>> // g++ -std=c++0x -c init_vvp.cpp
>> #include <vector>
>> #include <utility>
>> using std::vector;
>> using std::pair;
>> vector<vector<int>> vv = { {1,2,3}, {4,5,6}, {7,8,9} };
>> vector<pair<vector<int>,vector<int>>> vpv = { {{1,2,3},{-1,-2,-3}},
>> {{4,5,6},{-4,-5,-6}}, {{7,8,9},{-7-8-9}} };
>> vector<vector<pair<int,int>>> vvp = { {{1,-1},{2,-2},{3,-3}},
>> {{4,-4},{5,-5},{6,-6}}, {{7,-7},{8,-8},{9,-9}} };
>>
>> The mingw32 4.5.0 compiler gives an error on the last line (line 8):
>
> I think you have skipped the commas in the last triplet:
>>
>> {{4,5,6},{-4,-5,-6}}, {{7,8,9},{-7,-8,-9}} };
Yes, indeed I have -- a typo on my part.
Note, however, that this line (line 7 of my code sample) compiles
properly (even with the error). (It turns out that {-7-8-9} initializes the
vector that is a piece of the larger structure to {-24}, i.e., a vector of
length one with vec[0] = -24.)
Fixing the typo produces no substantive change: Line 8 (the test of
vector-of-vector-of-pair) still fails to compile with mingw32 4.5.0, but
does compile with mingw-w64, 4.5.2.
Thanks for the catch.
K. Frank
|