Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68165 - in trunk/boost: config/compiler detail
From: admin_at_[hidden]
Date: 2011-01-14 21:23:48


Author: wash
Date: 2011-01-14 21:23:46 EST (Fri, 14 Jan 2011)
New Revision: 68165
URL: http://svn.boost.org/trac/boost/changeset/68165

Log:
Make <boost/detail/iomanip.hpp> include <iomanip> and put the <iomanip> functions
in the boost::detail namespace if not on clang- or intel-linux.

Text files modified:
   trunk/boost/config/compiler/gcc.hpp | 2
   trunk/boost/detail/iomanip.hpp | 445 ++++++++++++++++++++-------------------
   2 files changed, 235 insertions(+), 212 deletions(-)

Modified: trunk/boost/config/compiler/gcc.hpp
==============================================================================
--- trunk/boost/config/compiler/gcc.hpp (original)
+++ trunk/boost/config/compiler/gcc.hpp 2011-01-14 21:23:46 EST (Fri, 14 Jan 2011)
@@ -13,6 +13,8 @@
 
 // GNU C++ compiler setup:
 
+#define BOOST_GCC 1
+
 #if __GNUC__ < 3
 # if __GNUC_MINOR__ == 91
        // egcs 1.1 won't parse shared_ptr.hpp without this:

Modified: trunk/boost/detail/iomanip.hpp
==============================================================================
--- trunk/boost/detail/iomanip.hpp (original)
+++ trunk/boost/detail/iomanip.hpp 2011-01-14 21:23:46 EST (Fri, 14 Jan 2011)
@@ -8,218 +8,239 @@
 #ifndef BOOST_DETAIL_IOMANIP_HPP
 #define BOOST_DETAIL_IOMANIP_HPP
 
-#include <ios>
-#include <istream>
-#include <ostream>
-
-namespace boost {
-namespace detail {
-
-//[resetiosflags
-class resetiosflags_manip {
- private:
- std::ios_base::fmtflags mask;
-
- public:
- explicit resetiosflags_manip (std::ios_base::fmtflags m):
- mask(m) { }
-
- template<class CharT, class Traits>
- friend std::basic_istream<CharT, Traits>&
- operator>> (std::basic_istream<CharT, Traits>& is,
- resetiosflags_manip const& x)
- {
- is.unsetf(x.mask);
- return is;
- }
-
- template<class CharT, class Traits>
- friend std::basic_ostream<CharT, Traits>&
- operator<< (std::basic_ostream<CharT, Traits>& os,
- resetiosflags_manip const& x)
- {
- os.unsetf(x.mask);
- return os;
- }
-};
-
-inline resetiosflags_manip resetiosflags (std::ios_base::fmtflags mask) {
- return resetiosflags_manip(mask);
-}
-//]
-
-//[setiosflags
-class setiosflags_manip {
- private:
- std::ios_base::fmtflags mask;
-
- public:
- explicit setiosflags_manip (std::ios_base::fmtflags m):
- mask(m) { }
-
- template<class CharT, class Traits>
- friend std::basic_istream<CharT, Traits>&
- operator>> (std::basic_istream<CharT, Traits>& is,
- setiosflags_manip const& x) {
- is.setf(x.mask);
- return is;
- }
-
- template<class CharT, class Traits>
- friend std::basic_ostream<CharT, Traits>&
- operator<< (std::basic_ostream<CharT, Traits>& os,
- setiosflags_manip const& x) {
- os.setf(x.mask);
- return os;
- }
-};
-
-inline setiosflags_manip setiosflags (std::ios_base::fmtflags mask) {
- return setiosflags_manip(mask);
-}
-//]
-
-//[setbase
-class setbase_manip {
- private:
- int base;
-
- public:
- explicit setbase_manip (int b):
- base(b) { }
-
- template<class CharT, class Traits>
- friend std::basic_istream<CharT, Traits>&
- operator>> (std::basic_istream<CharT, Traits>& is, setbase_manip const& x) {
- using namespace std;
- switch (x.base) {
- case 8:
- is << std::oct;
- return is;
- case 10:
- is << std::dec;
- return is;
- case 16:
- is << std::hex;
- return is;
- default:
- is.setf(ios_base::fmtflags(0), ios_base::basefield);
- return is;
- }
- }
-
- template <class CharT, class Traits>
- friend std::basic_ostream<CharT, Traits>&
- operator<< (std::basic_ostream<CharT, Traits>& os, setbase_manip const& x) {
- using namespace std;
- switch (x.base) {
- case 8:
- os << std::oct;
- return os;
- case 10:
- os << std::dec;
- return os;
- case 16:
- os << std::hex;
- return os;
- default:
- os.setf(ios_base::fmtflags(0), ios_base::basefield);
- return os;
- }
- }
-};
-
-inline setbase_manip setbase (int base) {
- return setbase_manip(base);
-}
-//]
-
-//[setfill
-template<class CharT>
-class setfill_manip {
- private:
- CharT fill;
-
- public:
- explicit setfill_manip (CharT c):
- fill(c) { }
-
- template<class Traits>
- friend std::basic_ostream<CharT, Traits>&
- operator<< (std::basic_ostream<CharT, Traits>& os, setfill_manip const& x) {
- os.fill(x.fill);
- return os;
- }
-};
-
-template<class CharT>
-inline setfill_manip<CharT> setfill (CharT c) {
- return setfill_manip<CharT>(c);
-}
-//]
-
-//[setprecision
-class setprecision_manip {
- private:
- int n;
-
- public:
- explicit setprecision_manip (int n_):
- n(n_) { }
-
- template<class CharT, class Traits>
- friend std::basic_istream<CharT, Traits>&
- operator>> (std::basic_istream<CharT, Traits>& is,
- setprecision_manip const& x) {
- is.precision(x.n);
- return is;
- }
-
- template<class CharT, class Traits>
- friend std::basic_ostream<CharT, Traits>&
- operator<< (std::basic_ostream<CharT, Traits>& os,
- setprecision_manip const& x) {
- os.precision(x.n);
- return os;
- }
-};
-
-inline setprecision_manip setprecision (int n_) {
- return setprecision_manip(n_);
-}
-//]
-
-//[setw
-class setw_manip {
- private:
- int n;
-
- public:
- explicit setw_manip (int n_):
- n(n_) { }
-
- template<class CharT, class Traits>
- friend std::basic_istream<CharT, Traits>&
- operator>> (std::basic_istream<CharT, Traits>& is, setw_manip const& x) {
- is.width(x.n);
- return is;
- }
-
- template <class CharT, class Traits>
- friend std::basic_ostream<CharT, Traits>&
- operator<< (std::basic_ostream<CharT, Traits>& os, setw_manip const& x) {
- os.width(x.n);
- return os;
- }
-};
-
-inline setw_manip setw (int n_) {
- return setw_manip(n_);
-}
-//]
+#include <boost/config.hpp>
 
-} // detail
-} // boost
+#if (defined(BOOST_CLANG) || defined(BOOST_INTEL_LINUX)) && \
+ defined(BOOST_GNU_STDLIB)
+ #include <ios>
+ #include <istream>
+ #include <ostream>
+
+ namespace boost {
+ namespace detail {
+
+ //[resetiosflags
+ class resetiosflags_manip {
+ private:
+ std::ios_base::fmtflags mask;
+
+ public:
+ explicit resetiosflags_manip (std::ios_base::fmtflags m):
+ mask(m) { }
+
+ template<class CharT, class Traits>
+ friend std::basic_istream<CharT, Traits>&
+ operator>> (std::basic_istream<CharT, Traits>& is,
+ resetiosflags_manip const& x)
+ {
+ is.unsetf(x.mask);
+ return is;
+ }
+
+ template<class CharT, class Traits>
+ friend std::basic_ostream<CharT, Traits>&
+ operator<< (std::basic_ostream<CharT, Traits>& os,
+ resetiosflags_manip const& x)
+ {
+ os.unsetf(x.mask);
+ return os;
+ }
+ };
+
+ inline resetiosflags_manip resetiosflags (std::ios_base::fmtflags mask) {
+ return resetiosflags_manip(mask);
+ }
+ //]
+
+ //[setiosflags
+ class setiosflags_manip {
+ private:
+ std::ios_base::fmtflags mask;
+
+ public:
+ explicit setiosflags_manip (std::ios_base::fmtflags m):
+ mask(m) { }
+
+ template<class CharT, class Traits>
+ friend std::basic_istream<CharT, Traits>&
+ operator>> (std::basic_istream<CharT, Traits>& is,
+ setiosflags_manip const& x) {
+ is.setf(x.mask);
+ return is;
+ }
+
+ template<class CharT, class Traits>
+ friend std::basic_ostream<CharT, Traits>&
+ operator<< (std::basic_ostream<CharT, Traits>& os,
+ setiosflags_manip const& x) {
+ os.setf(x.mask);
+ return os;
+ }
+ };
+
+ inline setiosflags_manip setiosflags (std::ios_base::fmtflags mask) {
+ return setiosflags_manip(mask);
+ }
+ //]
+
+ //[setbase
+ class setbase_manip {
+ private:
+ int base;
+
+ public:
+ explicit setbase_manip (int b):
+ base(b) { }
+
+ template<class CharT, class Traits>
+ friend std::basic_istream<CharT, Traits>&
+ operator>> (std::basic_istream<CharT, Traits>& is, setbase_manip const& x) {
+ using namespace std;
+ switch (x.base) {
+ case 8:
+ is << std::oct;
+ return is;
+ case 10:
+ is << std::dec;
+ return is;
+ case 16:
+ is << std::hex;
+ return is;
+ default:
+ is.setf(ios_base::fmtflags(0), ios_base::basefield);
+ return is;
+ }
+ }
+
+ template <class CharT, class Traits>
+ friend std::basic_ostream<CharT, Traits>&
+ operator<< (std::basic_ostream<CharT, Traits>& os, setbase_manip const& x) {
+ using namespace std;
+ switch (x.base) {
+ case 8:
+ os << std::oct;
+ return os;
+ case 10:
+ os << std::dec;
+ return os;
+ case 16:
+ os << std::hex;
+ return os;
+ default:
+ os.setf(ios_base::fmtflags(0), ios_base::basefield);
+ return os;
+ }
+ }
+ };
+
+ inline setbase_manip setbase (int base) {
+ return setbase_manip(base);
+ }
+ //]
+
+ //[setfill
+ template<class CharT>
+ class setfill_manip {
+ private:
+ CharT fill;
+
+ public:
+ explicit setfill_manip (CharT c):
+ fill(c) { }
+
+ template<class Traits>
+ friend std::basic_ostream<CharT, Traits>&
+ operator<< (std::basic_ostream<CharT, Traits>& os, setfill_manip const& x) {
+ os.fill(x.fill);
+ return os;
+ }
+ };
+
+ template<class CharT>
+ inline setfill_manip<CharT> setfill (CharT c) {
+ return setfill_manip<CharT>(c);
+ }
+ //]
+
+ //[setprecision
+ class setprecision_manip {
+ private:
+ int n;
+
+ public:
+ explicit setprecision_manip (int n_):
+ n(n_) { }
+
+ template<class CharT, class Traits>
+ friend std::basic_istream<CharT, Traits>&
+ operator>> (std::basic_istream<CharT, Traits>& is,
+ setprecision_manip const& x) {
+ is.precision(x.n);
+ return is;
+ }
+
+ template<class CharT, class Traits>
+ friend std::basic_ostream<CharT, Traits>&
+ operator<< (std::basic_ostream<CharT, Traits>& os,
+ setprecision_manip const& x) {
+ os.precision(x.n);
+ return os;
+ }
+ };
+
+ inline setprecision_manip setprecision (int n_) {
+ return setprecision_manip(n_);
+ }
+ //]
+
+ //[setw
+ class setw_manip {
+ private:
+ int n;
+
+ public:
+ explicit setw_manip (int n_):
+ n(n_) { }
+
+ template<class CharT, class Traits>
+ friend std::basic_istream<CharT, Traits>&
+ operator>> (std::basic_istream<CharT, Traits>& is, setw_manip const& x) {
+ is.width(x.n);
+ return is;
+ }
+
+ template <class CharT, class Traits>
+ friend std::basic_ostream<CharT, Traits>&
+ operator<< (std::basic_ostream<CharT, Traits>& os, setw_manip const& x) {
+ os.width(x.n);
+ return os;
+ }
+ };
+
+ inline setw_manip setw (int n_) {
+ return setw_manip(n_);
+ }
+ //]
 
-#endif // BOOST_DETAIL_IOMANIP_HPP
+ } // detail
+ } // boost
+
+#else
+ #include <iomanip>
+
+ namespace boost {
+ namespace detail {
 
+ using ::std::resetiosflags;
+ using ::std::setiosflags;
+ using ::std::setbase;
+ using ::std::setfill;
+ using ::std::setprecision;
+ using ::std::setw;
+
+ } // detail
+ } // boost
+
+#endif
+
+#endif // BOOST_DETAIL_IOMANIP_HPP


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk