Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66651 - trunk/boost
From: marshall_at_[hidden]
Date: 2010-11-19 19:48:34


Author: marshall
Date: 2010-11-19 19:48:33 EST (Fri, 19 Nov 2010)
New Revision: 66651
URL: http://svn.boost.org/trac/boost/changeset/66651

Log:
SunPro workaround; references #4757
Text files modified:
   trunk/boost/array.hpp | 35 ++++++++++++++++++++---------------
   1 files changed, 20 insertions(+), 15 deletions(-)

Modified: trunk/boost/array.hpp
==============================================================================
--- trunk/boost/array.hpp (original)
+++ trunk/boost/array.hpp 2010-11-19 19:48:33 EST (Fri, 19 Nov 2010)
@@ -346,21 +346,12 @@
         x.swap(y);
     }
 
-#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]
- {
- return arg.elems;
- }
-
- // Const version.
- template <typename T, std::size_t N>
- const T(&get_c_array(const boost::array<T,N>& 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<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
        {
@@ -381,6 +372,20 @@
    {
        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]
+ {
+ return arg.elems;
+ }
+
+ // Const version.
+ template <typename T, std::size_t N>
+ const T(&get_c_array(const boost::array<T,N>& arg))[N]
+ {
+ return arg.elems;
+ }
 #endif
         
 #if 0


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