[Boost-bugs] [ boost-Bugs-1427230 ] bug in output the range to an ostream

Bugs item #1427230, was opened at 2006-02-08 12:06 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1427230&group_id=7586 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: iterator Group: None Status: Open Resolution: None Priority: 5 Submitted By: e-poison (e-poison) Assigned to: David Abrahams (david_abrahams) Summary: bug in output the range to an ostream Initial Comment: followed code can't be compiled std::wstring ws(L"test"); boost::iterator_range<std::wstring::const_iterator> wrange(ws); std::wcout << wrange; // compilation error here It seems the implementation of operator << for iterator_range is not correct: File boost/iterator/iterator_range.hpp #ifndef BOOST_OLD_IOSTREAMS template< typename IteratorT, typename Elem, typename Traits > inline std::basic_ostream<Elem,Traits>& operator<<( std::basic_ostream<Elem, Traits>& Os, const iterator_range<IteratorT>& r ) { std::copy( r.begin(), r.end(), std::ostream_iterator<Elem>(Os)); return Os; } .. I guess the function body should be like this: { typedef typename iterator_value<IteratorT>::type ValueType; std::copy( r.begin(), r.end(), std::ostream_iterator<ValueType, Elem, Traits>(Os)); return Os; } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1427230&group_id=7586 ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ Boost-bugs mailing list Boost-bugs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/boost-bugs
participants (1)
-
SourceForge.net