Boost logo

Boost-Commit :

From: jefffaust_at_[hidden]
Date: 2007-05-24 19:23:36


Author: jefffaust
Date: 2007-05-24 19:23:36 EDT (Thu, 24 May 2007)
New Revision: 4230
URL: http://svn.boost.org/trac/boost/changeset/4230

Log:
Handle c-style arrays.

Text files modified:
   sandbox/explore/boost/explore/stream_container.hpp | 7 +++++++
   1 files changed, 7 insertions(+), 0 deletions(-)

Modified: sandbox/explore/boost/explore/stream_container.hpp
==============================================================================
--- sandbox/explore/boost/explore/stream_container.hpp (original)
+++ sandbox/explore/boost/explore/stream_container.hpp 2007-05-24 19:23:36 EDT (Thu, 24 May 2007)
@@ -227,6 +227,13 @@
         return stream_container(ostr, m.begin(), m.end(), stream_map_value());
     }
 
+ // stream c-array
+ template<typename Elem, typename Tr, typename T, std::size_t size>
+ std::basic_ostream<Elem, Tr>& operator<<(std::basic_ostream<Elem, Tr>& ostr, T (&a)[size])
+ {
+ return stream_container(ostr, &a[0], &a[size]);
+ }
+
     // function ptr for separator manipulator
     template<typename Elem, typename Tr>
     void setSeparatorFn(std::basic_ostream<Elem, Tr>& ostr, const Elem* sep)


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