Boost logo

Boost :

From: Bill Seymour (bsey_at_[hidden])
Date: 2001-02-12 14:37:43


Hi,

I'm a new member; but I don't yet have a submission to fail
miserably. 8-)

I've noticed a couple of problems that someone might want
to check out and maybe add to Boost's config.cpp:

1. MSVC++ v5 seems to have trouble applying a stream's width
to a std::string.

Consider:

    ostringstream ostr;
    ostr << "stuff";
    cout << setw(8) << ostr.str() << '.' << endl;

The width of 8 gets applied, not to ostr.str() as expected,
but to the period after it. Changing the last expression to:

    cout << setw(8) << ostr.str().c_str() << '.' << endl;

seems to solve the problem.

2. Borland v4 seems to have trouble with istream_iterators
when they're used to construct a collection.

Consider:

    ifstream is("file_name");
    vector<int> v(istream_iterator<int>(is),
                  istream_iterator<int>());

This seems to load at most one element into v, regardless of
the contents of the file. For example, with an input file
that contains one line:

    31 33 35

I get v.size() == 1, v.front() == 31, and is.bad() == false.
(I didn't think to check is.eof() or is.fail().)

Can anybody else confirm these?

Thanks,

--Bill Seymour


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