Boost logo

Boost :

From: Igor Okulist (okigan_at_[hidden])
Date: 2007-06-06 15:59:14


Appears as an issue in mapped_file.hpp if used with std::ios::in.
Issue appears as a copy paste problem from mapped_file_source class.
Issue manifest that const_begin() always return 0 (zero) and const_end()
return 0+size(). To correct the problem const_data() method shall be called
instead of data(). Below is diff with current version:

--- \boost\include\boost-1_33_1\boost\iostreams\device\mapped_file.hpp.org
+++ \boost\include\boost-1_33_1\boost\iostreams\device\mapped_file.hpp
@@ -191,9 +191,9 @@
     }
     const char* const_data() const { return delegate_.data(); }
     iterator begin() const { return data(); }
- const_iterator const_begin() const { return data(); }
+ const_iterator const_begin() const { return const_data(); }
     iterator end() const { return data() + size(); }
- const_iterator const_end() const { return data() + size(); }
+ const_iterator const_end() const { return const_data() + size(); }

Please enter into bug database (do i need to subscribe to Track to do
it myself?).
Thanks,
Igor




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk