stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Pevtsov <>
Subject test for
Date Tue, 20 Jun 2006 15:29:16 GMT
Martin, I am working on the test for and there are several

1. Shall we implement an our own locale class to exercise the >> and <<
operators using it?

2. Small question about, paragraph 4:

Effects: Begins by constructing a sentry object k as if k were
constructed by typename basic_ostream<chart, thraits>::sentry k(os). 
If bool(k) is true, inserts characters as if by calling
os.rdbuf()->sputn(, n), padding as described in stage 3 of, where n is the larger of os.width() and str.size(); then
calls os.width(0). If the call to sputn fails, calls

As I understand os.width(0) should be called if bool(k) is true only. I
not sure, but Dinkumware STL from MSVC and STLPort does that while
stdcxx calls os.with(0) in any case:


//, p3 - defined here, declared inline in <string>
template<class _CharT, class _Traits, class _Allocator> inline
basic_ostream<_CharT, _Traits>&
operator<< (basic_ostream<_CharT, _Traits>                  & __strm,
            const basic_string<_CharT, _Traits, _Allocator> &__str) {
    _RW::__rw_insert (__strm, (), __str.length (),
                      __strm.width ()).width (0);
    return __strm;
Is this correct?
The attached small test (iocheck.cpp) to illustrate this situation. 

3. Another small question about paragraph 4:

The stdcxx calls os.setstate(ios_base::badbit). Dinkumware STL does the
same. STLPort  - according to standard.

The attached small test (iocheck2.cpp) to illustrate this situation. 

What do you think about this?

Anton Pevtsov

View raw message