id summary reporter owner description type status milestone component version severity resolution keywords cc 6811 Default argument of type multi_array fails under MSVC 2010 SP1 Bruce Merry Ronald Garcia "When I write a function with the signature {{{ typedef boost::multi_array T; void bar(const T &value = T()) }}} and compile it with MSVC 2010 SP1 I get the following error messages {{{ E:\postdoc\boost-bug>cl /EHsc /Ie:/postdoc/tools/boost_1_49_0 mar-bug.cpp Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64 Copyright (C) Microsoft Corporation. All rights reserved. mar-bug.cpp e:/postdoc/tools/boost_1_49_0\boost/multi_array/multi_array_ref.hpp(73) : error C3855: 'boost::const_multi_array_ref': template parameter 'NumDims' is incompati ble with the declaration e:/postdoc/tools/boost_1_49_0\boost/multi_array/multi_array_ref.hpp(417) : see reference to class template instantiation 'boost::const_multi_array_ref' being compiled with [ T=int, NumDims=0x03, TPtr=int * ] e:/postdoc/tools/boost_1_49_0\boost/multi_array.hpp(113) : see reference to class template instantiation 'boost::multi_array_ref' being compi led with [ T=int, NumDims=0x03 ] mar-bug.cpp(5) : see reference to class template instantiation 'boost::m ulti_array' being compiled with [ T=int, NumDims=0x03 ] }}} The offending piece of code appears to be in `boost/multi_array/multi_array_ref.hpp`: {{{ #ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS // make const_multi_array_ref a friend of itself template friend class const_multi_array_ref; #endif }}} If I give the template arguments names then the compiler is happy (I'll attach a patch). I have no idea what is special about using the type as a default argument - I tried to reproduce it using simpler steps (copy constructor, default constructor, assigning a temporary to a const ref inside a function) with no luck." Bugs new To Be Determined multi_array Boost 1.49.0 Problem