Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67477 - in branches/release: boost libs/array/test
From: marshall_at_[hidden]
Date: 2010-12-28 13:28:28


Author: marshall
Date: 2010-12-28 13:28:22 EST (Tue, 28 Dec 2010)
New Revision: 67477
URL: http://svn.boost.org/trac/boost/changeset/67477

Log:
Merged array changes to release; fixes #4757
Added:
   branches/release/libs/array/test/array6.cpp (props changed)
      - copied unchanged from r67476, /trunk/libs/array/test/array6.cpp
Properties modified:
   branches/release/boost/array.hpp (contents, props changed)
   branches/release/libs/array/test/Jamfile.v2 (contents, props changed)
Text files modified:
   branches/release/boost/array.hpp | 32 ++++++++++++++++++++++++++++++--
   branches/release/libs/array/test/Jamfile.v2 | 1 +
   2 files changed, 31 insertions(+), 2 deletions(-)

Modified: branches/release/boost/array.hpp
==============================================================================
--- branches/release/boost/array.hpp (original)
+++ branches/release/boost/array.hpp 2010-12-28 13:28:22 EST (Tue, 28 Dec 2010)
@@ -346,7 +346,34 @@
         x.swap(y);
     }
 
- // Specific for boost::array: simply returns its elems data member.
+#if defined(__SUNPRO_CC)
+// Trac ticket #4757; the Sun Solaris compiler can't handle
+// syntax like 'T(&get_c_array(boost::array<T,N>& arg))[N]'
+//
+// We can't just use this for all compilers, because the
+// borland compilers can't handle this form.
+ 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>
+ typename const detail::c_array<T,N>::type& get_c_array(const boost::array<T,N>& arg)
+ {
+ return arg.elems;
+ }
+#else
+// 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 +386,8 @@
     {
         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

Modified: branches/release/libs/array/test/Jamfile.v2
==============================================================================
--- branches/release/libs/array/test/Jamfile.v2 (original)
+++ branches/release/libs/array/test/Jamfile.v2 2010-12-28 13:28:22 EST (Tue, 28 Dec 2010)
@@ -11,4 +11,5 @@
     [ run array3.cpp ]
     [ run array4.cpp ]
     [ run array5.cpp ]
+ [ run array6.cpp ]
     ;


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