Boost logo

Boost :

From: Alexandre Karev (Alexandre.Karev_at_[hidden])
Date: 1999-10-14 02:56:05

>However, could you tell me
> - why you had to include <cstddef>
> - why you had to include <iterator>
>I don't see the the need to include them at the moment.
>So may be I am wrong or the library headers are incorrect.

        Hello, Nicolai!

        I'll start with second question because it is very simple:
        <iterator> has been included for ostream_iterator definition.
        At least in the STLport it defined there.

        An answer for a first one is - to avoid to be dependent on the
        include file order.
        For example. If the order in Your tests will be

                #include <algorithm>
                #include <functional>
                #include <iostream>
                #include <vector>

        everything goes fine (this order from compose1.cpp, BTW).

        But You have:

                #include <iostream>
                #include <vector>
                #include <algorithm>
                #include <functional>

        In this case somewhere in depth I got ptrdiff_t undefined.
        So for me to be safe from include file order I had to include
        <cstddef> before <iostream>.
        Of course it can be broken library implementation but that fix
        works for me.

                Thank You, Sasha.

 Alexandre Karev  EP/CERN  Alexandre.Karev_at_[hidden]
"The most difficult thing is to prove the evident".
                                       Folk wisdom.

Boost list run by bdawes at, gregod at, cpdaniel at, john at