diff --git a/include/boost/array.hpp b/include/boost/array.hpp index e80080c..0a197b1 100644 --- a/include/boost/array.hpp +++ b/include/boost/array.hpp @@ -346,21 +346,12 @@ namespace boost { x.swap(y); } -#if 0 - // Specific for boost::array: simply returns its elems data member. - template - T(&get_c_array(boost::array& arg))[N] - { - return arg.elems; - } - - // Const version. - template - const T(&get_c_array(const boost::array& arg))[N] - { - return arg.elems; - } -#else +#if defined(__SUNPRO_CC) +// Trac ticket #4757; the Sun Solaris compiler can't handle +// syntax like 'T(&get_c_array(boost::array& arg))[N]' +// +// We can't just use this for all compilers, because the +// borland compilers can't handle this form. namespace detail { template struct c_array { @@ -381,6 +372,20 @@ namespace boost { { return arg.elems; } +#else +// Specific for boost::array: simply returns its elems data member. + template + T(&get_c_array(boost::array& arg))[N] + { + return arg.elems; + } + + // Const version. + template + const T(&get_c_array(const boost::array& arg))[N] + { + return arg.elems; + } #endif #if 0