This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
On Tue, Apr 29, 2003 at 07:46:44PM +0200, Paolo Carlini wrote:But what about off_type, which is (for the accidental list reader ;)
If you know that one pointer is more than the other (e.g. becausereading and re-reading this code I noticed another minor inconsistency.
size_t __buf_len = _M_in_end - _M_in_cur;
whereas, in the latter:
off_type __buf_len = _M_out_end - _M_out_cur;
Which one is right???
of a prior comparison, or because the invariants say you can assume it) then you should use size_t. In this case there is no such invariant, so you should use ptrdiff_t, and using size_t is actually
wrong. (The __copy_streambufs code I showed you has this mistake.)
template<typename _CharT, typename _Traits>
class basic_streambuf
{
public:
typedef typename traits_type::off_type off_type;| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |