Missing include for boost::format

Hi, The Format headers in the main CVS are missing some #include for I/O streams. For example, if you try to compile this snippet: #include <boost/format.hpp> #include <string> int main() { std::string a = (boost::format("%1%") % 0).str(); } GCC will complain that error: base class `std::basic_ostream<char, std::char_traits<char> >' has incomplete type Regards, Guillaume

On Wed, 2004-02-04 at 17:30, Guillaume Melquiond wrote:
Hi,
The Format headers in the main CVS are missing some #include for I/O streams. For example, if you try to compile this snippet:
#include <boost/format.hpp> #include <string> int main() { std::string a = (boost::format("%1%") % 0).str(); }
GCC will complain that
error: base class `std::basic_ostream<char, std::char_traits<char> >' has incomplete type
thanks for spotting this, my test files are including <ostream> indirectly thru test_tools.hpp so I hadnt noticed. that's a consequence of the recent changes I made in the cvs head, I replaced std::stringstream with a custom stringstream and forgot to include <ostream> .. (BTW the custom stringstream which broke msvc 6 and 7.0 compatibility, but hopefully not for long.) I will fix it in a few minutes. -- Samuel

Samuel Krempp wrote:
error: base class `std::basic_ostream<char, std::char_traits<char> >' has incomplete type
thanks for spotting this, my test files are including <ostream> indirectly thru test_tools.hpp so I hadnt noticed.
I'm saying that like that, but where I was working before (and I intent to introduce it where I work now), I added a test to compile all .h/.hpp files with an empty .cpp including them. This way, all headers are ensured to be self-contained. Maybe that would be a nice addition to boost library tests? Regards, Nicolas Fleury
participants (3)
-
Guillaume Melquiond
-
Nicolas Fleury
-
Samuel Krempp