Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66154 - trunk/boost
From: marshall_at_[hidden]
Date: 2010-10-23 15:11:19


Author: marshall
Date: 2010-10-23 15:11:16 EDT (Sat, 23 Oct 2010)
New Revision: 66154
URL: http://svn.boost.org/trac/boost/changeset/66154

Log:
Fix elems for Sun compilers
Text files modified:
   trunk/boost/array.hpp | 27 +++++++++++++++++++++++++--
   1 files changed, 25 insertions(+), 2 deletions(-)

Modified: trunk/boost/array.hpp
==============================================================================
--- trunk/boost/array.hpp (original)
+++ trunk/boost/array.hpp 2010-10-23 15:11:16 EDT (Sat, 23 Oct 2010)
@@ -346,7 +346,8 @@
         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 <typename T, std::size_t N>
     T(&get_c_array(boost::array<T,N>& arg))[N]
     {
@@ -359,7 +360,29 @@
     {
         return arg.elems;
     }
-
+#else
+ namespace detail {
+ template <typename T, std::size_t N> struct c_array
+ {
+ typedef T type[N];
+ };
+ }
+
+ // Specific for boost::array: simply returns its elems data member.
+ template <typename T, std::size_t N>
+ typename detail::c_array<T,N>::type& get_c_array(boost::array<T,N>& arg)
+ {
+ return arg.elems;
+ }
+
+ // Specific for boost::array: simply returns its elems data member.
+ template <typename T, std::size_t N>
+ const typename detail::c_array<T,N>::type& get_c_array(const boost::array<T,N>& 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


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk