From 4a1c553f908ef92c0e1fde05c6fd984d689b27da Mon Sep 17 00:00:00 2001 From: Bryce Adelstein-Lelbach Date: Fri, 14 Jan 2011 02:35:58 +0000 Subject: [PATCH] Replacing the use of with across Boost. On Linux, GNU's libstdc++, which is the default stdlib for icc and clang, cannot parse the header in version 4.5+ (which thankfully neither compiler advises the use of yet), as it's original C++98-friendly implementation has been replaced with a gnu++0x implementation. is a portable implementation of , providing boost::detail::setfill, boost::detail::setbase, boost::detail::setw, boost::detail::setprecision, boost::detail::setiosflags and boost::detail::resetiosflags. [SVN r68140] --- test/iomanip_test.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/test/iomanip_test.cpp b/test/iomanip_test.cpp index 0a4f76d..60d91c3 100644 --- a/test/iomanip_test.cpp +++ b/test/iomanip_test.cpp @@ -1,13 +1,14 @@ -/*<-============================================================================ - Copyright (c) 2010 Bryce Lelbach +/*============================================================================== + Copyright (c) 2010-2011 Bryce Lelbach Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -============================================================================->*/ +==============================================================================*/ #include #include +#include #include #include @@ -18,39 +19,39 @@ int main (void) { //[setbase_test oss << setbase(8) << 8; - BOOST_TEST(oss.str() == "10"); + BOOST_TEST_EQ(oss.str(), "10"); oss.str(""); oss << setbase(10) << 10; - BOOST_TEST(oss.str() == "10"); + BOOST_TEST_EQ(oss.str(), "10"); oss.str(""); oss << setbase(16) << 16; - BOOST_TEST(oss.str() == "10"); + BOOST_TEST_EQ(oss.str(), "10"); //] //[setiosflags_test oss.str(""); oss << setiosflags(std::ios_base::showbase | std::ios_base::hex) << 16; - BOOST_TEST(oss.str() == "0x10"); + BOOST_TEST_EQ(oss.str(), "0x10"); //] //[resetiosflags_test oss.str(""); oss << resetiosflags(std::ios_base::showbase | std::ios_base::hex) << 16; - BOOST_TEST(oss.str() == "16"); + BOOST_TEST_EQ(oss.str(), "16"); //] //[setprecision_test oss.str(""); oss << setprecision(4) << 3.14159; - BOOST_TEST(oss.str() == "3.142"); + BOOST_TEST_EQ(oss.str(), "3.142"); //] //[setfill_and_setw_test oss.str(""); oss << setfill('*') << setw(5) << 9; - BOOST_TEST(oss.str() == "****9"); + BOOST_TEST_EQ(oss.str(), "****9"); //] return boost::report_errors();