Re: [Cppunit-devel] Duplicated #includes
Brought to you by:
blep
From: Steve M. R. <ste...@vi...> - 2001-09-25 14:41:02
|
Hello, Sorry for being so dense this morning, but: do the duplicated includes cause any trouble? On Tue, Sep 25, 2001 at 02:30:33PM +0100, Summerwill, Bob wrote: > Baptiste wrote ... > > >> Shoudln't that <string> only be included if you don't have > >> CPPUNIT_HAVE_SSTREAM anyway ? > > I'm not sure. Presumably it's there so that the inline implementation > of OStringStream::str() can construct the msg local variable, in which > case you are probably correct. Yeah, you're right, it could be protected. > >> Wouldn't it be better to move the declaration of OStringStream in > >> its one header (include/cppunit/portability, include/cppunit/tools ?), > >> and includes it only where it is used ? The whole reason for "Portability" is so that you can just #include it, and then assume a whole bunch of things. Like class OStringStream is defined. I would argue that including <string> unconditionally in "Portability.h" is also a good thing. It is true that at present, OStringStream is only used in a couple of the CppUnit sources. However, users that define their own assertion_traits (i.e. ME!) also use OStringStream. It is convenient to include a single CppUnit header and have everything I need defined. As I said above: I don't understand the concern over a few extra includes. -Steve -- by Rocket to the Moon, by Airplane to the Rocket, by Taxi to the Airport, by Frontdoor to the Taxi, by throwing back the blanket and laying down the legs ... - They Might Be Giants |