I like to initialize 2-dimensional arrays as
x is passed to
vector<vector<int> >'s constructor and
y is passed to
x times. Although this seems to be forbidden by C++03, because the constructor is
explicit, it always works, even on Comeau. I can also call
vector::assign like this. But, for some reason, not
vector< vector< int > > v( 20, 40 ); // OK: convert 40 to const T& v.assign( 30, 50 ); // OK v.push_back( 2 ); // error: no conversion, no matching function, etc.
Are the first two examples actually compliant for some reason? Why can I convert
50 but not
Epilogue: see http://gcc.gnu.org/onlinedocs/libstdc++/ext/lwg-defects.html#438 for why most compilers allow this, but the standard is shifting the other way.