Re: Need for #include <ios>
Gennaro Prota wrote:
On 15 Aug 2006 11:56:15 -0400, James Kanze <kanze.james@neuf.fr>
wrote:
Personally, I rather liked the idea that each header only
included a minimum, and that you only included the headers you
absolutely needed.
Indeed. The partitioning of standard headers is in fact on the
opposite front (I'm curious: if you only need std::min or max,
do you include <algorithm>?).
I think it is rather inconsistent. Each separate container type
has a separate header, but all of the algorithms are collected
into a single header. As for std::auto_ptr ending up in
<memory>, along side of std::allocator...
Of course, the correct division isn't always obvious. At first
glance, for example, std::accumulate is right where it should
be, along side of std::inner_product, std::partial_sum and such
things. But it still seems funny to me to have to include
<numeric> to calculate a CRC or a MD5 digest.
What's worse, I've seen lot of standard proposals taking shape
on the Boost list; and what where several, reasonably
articulated, include files inevitably became a single
monolithic <>-style header in the final paper, under the
belief that this was "the standard way" to go. Hard to explain
why the partitioning itself isn't considered part of the
existing library practice.
On the other hand, I'd rather prefer knowing exactly what I'm
getting. Something like "#include <std>, and you get the entire
standard library, don't include it, and you get none of the
standard library" is clear and unambiguous. As opposed to the
current situation, where '#include <iostream>', and you might
get anything from a very small minimum to the entire standard
library.
--
James Kanze GABI Software
Conseils en informatique orient?e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S?mard, 78210 St.-Cyr-l'?cole, France, +33 (0)1 30 23 00 34
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]