id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 1778,Possible regression in 1.35 serialization of 2D arrays,dgt@…,Matthias Troyer,"Our product has been using 1.34.1 for a while with no problems. However, upon upgrading to 1.35, I get the following compile error on MSVC2005 (32bit). '''D:\tools\boost\boost_1_35_0\boost/archive/detail/oserializer.hpp(489) : error C2440: 'static_cast' : cannot convert from 'const char (*__w64 )[16]' to 'value_type *'''' A 2D char array is being serialized as: {{{ char c[5][16]; ar & make_nvp(""c"", c); }}} ---------------------------- While I don't have but a high-level grasp of MPL, it seems to me that remove_all_extents::type is stripping off all the dimensions, which causes line 489 to fail. If instead, I serialize as: {{{ ar & make_nvp(""c"", make_array(&c[0], sizeof(c)/sizeof(c[0]) ); }}} It of course works. I can do the following as well: {{{ ar & make_nvp(""c"", make_array(&c[0][0], sizeof(c)/sizeof(c[0][0]) ); }}} ---------------------------- I don't want to use any of the above because there are quite a few of these 2D arrays floating around. They don't contain large blocks of data, so I'm not interested in the make_array optimization at this time. I've created two wrappers which make things a little easier (shamelessly based on your make_array). I can't provide them as make_array overloads because oserializer then erroneously tries to pick one. {{{ template inline #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING const #endif array make_array2D( T (& t)[M][N] ) { return array(&t[0], M); } template inline #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING const #endif array make_array2D_flatten( T (& t)[M][N]) { return array(static_cast(&t[0][0]), N*M); } }}} --------------------------------- Anyways, just thought I'd let you know what I've run into.",Bugs,closed,,serialization,Boost 1.35.0,Regression,fixed,,