From: Sylwester A. <sa...@ig...> - 2013-06-27 20:22:50
|
Hi, On 26/06/13 11:18, Boštjan Vesnicer wrote: > e) this doesn't work > Array<double, 2> A(ColumnMajorArray<2>()); > A.resize(2, 2); Trying it with clang gives: $ clang++ test.cpp test.cpp:7:21: warning: parentheses were disambiguated as a function declaration [-Wvexing-parse] Array<double, 2> A(ColumnMajorArray<2>()); ^~~~~~~~~~~~~~~~~~~~~~~ test.cpp:7:22: note: add a pair of parentheses to declare a variable Array<double, 2> A(ColumnMajorArray<2>()); ^ ( ) test.cpp:8:4: error: member reference base type 'Array<double, 2> (ColumnMajorArray<2> (*)())' is not a structure or union A.resize(2, 2); ~^~~~~~~ 1 warning and 1 error generated. Adding the suggested parentheses indeed helps. HTH, Regards, Sylwester -- http://www.igf.fuw.edu.pl/~slayoo/ |