Boost logo

Boost-Commit :

From: nicola.musatti_at_[hidden]
Date: 2007-10-14 13:53:16


Author: nmusatti
Date: 2007-10-14 13:53:15 EDT (Sun, 14 Oct 2007)
New Revision: 40020
URL: http://svn.boost.org/trac/boost/changeset/40020

Log:
Applied patch from Ticket #1320
Text files modified:
   trunk/boost/range/as_literal.hpp | 15 +++++++++++++--
   1 files changed, 13 insertions(+), 2 deletions(-)

Modified: trunk/boost/range/as_literal.hpp
==============================================================================
--- trunk/boost/range/as_literal.hpp (original)
+++ trunk/boost/range/as_literal.hpp 2007-10-14 13:53:15 EDT (Sun, 14 Oct 2007)
@@ -21,6 +21,9 @@
 
 #include <boost/range/iterator_range.hpp>
 #include <boost/range/detail/str_types.hpp>
+
+#include <boost/detail/workaround.hpp>
+
 #include <cstring>
 #include <cwchar>
 
@@ -104,15 +107,23 @@
     template< class Char, std::size_t sz >
     inline iterator_range<Char*> as_literal( Char (&arr)[sz] )
     {
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x590)) && __BORLANDC__ >= 0x590
+ return boost::make_iterator_range<Char*>( arr, arr + sz - 1 );
+#else
         return boost::make_iterator_range( arr, arr + sz - 1 );
+#endif
     }
 
     
     template< class Char, std::size_t sz >
- inline iterator_range<const Char*> as_literal( const Char (&arr)[sz] )
+ inline iterator_range<const Char*> as_literal( const Char (&arr)[sz] )
     {
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x590)) && __BORLANDC__ >= 0x590
+ return boost::make_iterator_range<const Char*>( arr, arr + sz - 1 );
+#else
         return boost::make_iterator_range( arr, arr + sz - 1 );
- }
+#endif
+ }
 }
 
 #endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING


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