Opened 10 years ago
Last modified 9 years ago
#7250 new Feature Requests
rational.hpp imports header iostream even if stream operators are not needed
Reported by: | Owned by: | Jonathan Turkanis | |
---|---|---|---|
Milestone: | To Be Determined | Component: | rational |
Version: | Boost 1.51.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Many Boost libraries have header variants with and without iostream support:
#include "boost/date_time/posix_time/posix_time.hpp" //include all types plus i/o
or
#include "boost/date_time/posix_time/posix_time_types.hpp" //no i/o just types
Likewise, there exists a macro BOOST_NO_IOSTREAM, which should prevent <iostream> from being included, see ticket #4060.
Neither approaches are available in boost::rational<> but either could be put to good use.
Note:
See TracTickets
for help on using tickets.
Looking at Config's documentation, it seems that
BOOST_NO_IOSTREAM
is descriptive, not proscriptive. It is meant to flag when an implementation doesn't have IOStreams installed (like free-standing environments), not disable IOStreams even when the compiler supports it.Rational's implementation is just one header file, so separating I/O will make things more complex, as opposed to libraries that are already a bunch of headers and so one more won't make too much of a difference.