From 38217688e1a217d4230eba132013c1a99c19f09f Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Sat, 23 Oct 2010 19:11:16 +0000 Subject: [PATCH] Fix elems for Sun compilers [SVN r66154] --- include/boost/array.hpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/include/boost/array.hpp b/include/boost/array.hpp index 7df2771..e80080c 100644 --- a/include/boost/array.hpp +++ b/include/boost/array.hpp @@ -346,7 +346,8 @@ namespace boost { x.swap(y); } - // Specific for boost::array: simply returns its elems data member. +#if 0 + // Specific for boost::array: simply returns its elems data member. template T(&get_c_array(boost::array& arg))[N] { @@ -359,7 +360,29 @@ namespace boost { { return arg.elems; } +#else + namespace detail { + template struct c_array + { + typedef T type[N]; + }; + } + + // Specific for boost::array: simply returns its elems data member. + template + typename detail::c_array::type& get_c_array(boost::array& arg) + { + return arg.elems; + } + // Specific for boost::array: simply returns its elems data member. + template + const typename detail::c_array::type& get_c_array(const boost::array& arg) + { + return arg.elems; + } +#endif + #if 0 // Overload for std::array, assuming that std::array will have // explicit conversion functions as discussed at the WG21 meeting