123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- #ifndef BOOST_CHRONO_UTILITY_MANIP_BASE_PTR_HPP
- #define BOOST_CHRONO_UTILITY_MANIP_BASE_PTR_HPP
- #include <ios>
- namespace boost
- {
- namespace chrono
- {
-
- template <typename Final>
- class manip
- {
- public:
-
-
- void operator()(std::ios_base &ios) const
- {
- (*static_cast<const Final *> (this))(ios);
- }
- };
-
- template <typename out_stream, typename manip_type>
- out_stream &operator<<(out_stream &out, const manip<manip_type> &op)
- {
- if (out.good())
- op(out);
- return out;
- }
-
- template <typename in_stream, typename manip_type>
- in_stream &operator>>(in_stream &in, const manip<manip_type> &op)
- {
- if (in.good())
- op(in);
- return in;
- }
- }
- }
- #endif
|