This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[RFC] So, which is the correct type of _M_*_end - _M_*_cur?
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: libstdc++ at gcc dot gnu dot org
- Date: Tue, 29 Apr 2003 19:46:44 +0200
- Subject: [RFC] So, which is the correct type of _M_*_end - _M_*_cur?
Hi,
reading and re-reading this code I noticed another minor
inconsistency.
In streambuf.tcc we can find two very neat and symmetric
implementations of basic_streambuf::xsgetn and
basic_streambuf::xsputn, but, in the former:
//
while (__ret < __n)
{
size_t __buf_len = _M_in_end - _M_in_cur;
if (__buf_len > 0)
{
size_t __remaining = __n - __ret;
size_t __len = std::min(__buf_len, __remaining);
//
whereas, in the latter:
//
while (__ret < __n)
{
off_type __buf_len = _M_out_end - _M_out_cur;
if (__buf_len > 0)
{
off_type __remaining = __n - __ret;
off_type __len = std::min(__buf_len, __remaining);
//
Which one is right???
Paolo.