Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80443 - in trunk: boost/chrono boost/chrono/io boost/chrono/stopwatches/formatters libs/chrono/doc libs/chrono/doc/stopwatches
From: vicente.botet_at_[hidden]
Date: 2012-09-08 08:13:10


Author: viboes
Date: 2012-09-08 08:13:09 EDT (Sat, 08 Sep 2012)
New Revision: 80443
URL: http://svn.boost.org/trac/boost/changeset/80443

Log:
Chrono: Added BOOST_CHRONO_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0 macro
Text files modified:
   trunk/boost/chrono/chrono_io.hpp | 12 +++++++++-
   trunk/boost/chrono/config.hpp | 25 ++++++++++++++++++++++
   trunk/boost/chrono/io/ios_base_state.hpp | 4 +-
   trunk/boost/chrono/stopwatches/formatters/accumulator_set_formatter.hpp | 3 -
   trunk/boost/chrono/stopwatches/formatters/elapsed_formatter.hpp | 3 -
   trunk/libs/chrono/doc/chrono.qbk | 43 +++++++++++++++++++++++++++++++--------
   trunk/libs/chrono/doc/stopwatches/reference.qbk | 8 +++---
   7 files changed, 76 insertions(+), 22 deletions(-)

Modified: trunk/boost/chrono/chrono_io.hpp
==============================================================================
--- trunk/boost/chrono/chrono_io.hpp (original)
+++ trunk/boost/chrono/chrono_io.hpp 2012-09-08 08:13:09 EDT (Sat, 08 Sep 2012)
@@ -14,10 +14,18 @@
 #define BOOST_CHRONO_CHRONO_IO_HPP
 
 #include <boost/chrono/config.hpp>
-#if BOOST_CHRONO_VERSION == 2
+
+//#if BOOST_CHRONO_VERSION == 2
+//#include <boost/chrono/io/time_point_io.hpp>
+//#include <boost/chrono/io/duration_io.hpp>
+//#elif BOOST_CHRONO_VERSION == 1
+//#include <boost/chrono/io_v1/chrono_io.hpp>
+//#endif
+
+#if defined BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0
 #include <boost/chrono/io/time_point_io.hpp>
 #include <boost/chrono/io/duration_io.hpp>
-#elif BOOST_CHRONO_VERSION == 1
+#else
 #include <boost/chrono/io_v1/chrono_io.hpp>
 #endif
 

Modified: trunk/boost/chrono/config.hpp
==============================================================================
--- trunk/boost/chrono/config.hpp (original)
+++ trunk/boost/chrono/config.hpp 2012-09-08 08:13:09 EDT (Sat, 08 Sep 2012)
@@ -114,6 +114,28 @@
 #endif
 #endif
 
+#if defined BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING \
+ && defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
+#error "BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING && BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING defined"
+#endif
+
+#if defined BOOST_CHRONO_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0 \
+ && defined BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0
+#error "BOOST_CHRONO_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0 && BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0 defined"
+#endif
+
+#if ! defined BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING \
+ && ! defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
+#define BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING
+#endif
+
+#if (BOOST_CHRONO_VERSION == 2)
+#if ! defined BOOST_CHRONO_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0 \
+ && ! defined BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0
+#define BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0
+#endif
+#endif
+
 #ifdef BOOST_CHRONO_HEADER_ONLY
 #define BOOST_CHRONO_INLINE inline
 #define BOOST_CHRONO_STATIC inline
@@ -143,7 +165,7 @@
 #define BOOST_CHRONO_DECL
 #endif
 
-//#define BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
+
 
 // enable automatic library variant selection ------------------------------//
 
@@ -166,3 +188,4 @@
 #endif // auto-linking disabled
 #endif // BOOST_CHRONO_HEADER_ONLY
 #endif // BOOST_CHRONO_CONFIG_HPP
+

Modified: trunk/boost/chrono/io/ios_base_state.hpp
==============================================================================
--- trunk/boost/chrono/io/ios_base_state.hpp (original)
+++ trunk/boost/chrono/io/ios_base_state.hpp 2012-09-08 08:13:09 EDT (Sat, 08 Sep 2012)
@@ -131,13 +131,13 @@
     } // namespace detail
 
     template<typename CharT>
- static inline std::basic_string<CharT> get_time_fmt(std::ios_base & ios)
+ inline std::basic_string<CharT> get_time_fmt(std::ios_base & ios)
     {
       ios_state_not_null_ptr<detail::ios_base_data<CharT>, detail::ios_base_data_aux<CharT> > ptr(ios);
       return ptr->time_fmt;
     }
     template<typename CharT>
- static inline void set_time_fmt(std::ios_base& ios, std::basic_string<
+ inline void set_time_fmt(std::ios_base& ios, std::basic_string<
         CharT> const& fmt)
     {
       ios_state_not_null_ptr<detail::ios_base_data<CharT>, detail::ios_base_data_aux<CharT> > ptr(ios);

Modified: trunk/boost/chrono/stopwatches/formatters/accumulator_set_formatter.hpp
==============================================================================
--- trunk/boost/chrono/stopwatches/formatters/accumulator_set_formatter.hpp (original)
+++ trunk/boost/chrono/stopwatches/formatters/accumulator_set_formatter.hpp 2012-09-08 08:13:09 EDT (Sat, 08 Sep 2012)
@@ -8,9 +8,8 @@
 #define BOOST_CHRONO_STOPWATCHES_FORMATTERS_ACCUMULATOR_SET_HPP
 
 #include <boost/chrono/stopwatches/formatters/base_formatter.hpp>
-//#include <boost/chrono/detail/system.hpp>
+#include <boost/chrono/chrono_io.hpp>
 #include <boost/current_function.hpp>
-//#include <boost/chrono/stopwatches/detail/adaptive_string.hpp>
 #include <boost/accumulators/framework/accumulator_set.hpp>
 #include <boost/accumulators/statistics/count.hpp>
 #include <boost/accumulators/statistics/sum.hpp>

Modified: trunk/boost/chrono/stopwatches/formatters/elapsed_formatter.hpp
==============================================================================
--- trunk/boost/chrono/stopwatches/formatters/elapsed_formatter.hpp (original)
+++ trunk/boost/chrono/stopwatches/formatters/elapsed_formatter.hpp 2012-09-08 08:13:09 EDT (Sat, 08 Sep 2012)
@@ -8,9 +8,8 @@
 #define BOOST_CHRONO_STOPWATCHES_FORMATTERS_ELAPSED_HPP
 
 #include <boost/chrono/stopwatches/formatters/base_formatter.hpp>
-//#include <boost/chrono/detail/system.hpp>
+#include <boost/chrono/chrono_io.hpp>
 #include <boost/current_function.hpp>
-//#include <boost/chrono/stopwatches/detail/adaptive_string.hpp>
 #include <boost/format.hpp>
 #include <boost/format/group.hpp>
 #include <boost/cstdint.hpp>

Modified: trunk/libs/chrono/doc/chrono.qbk
==============================================================================
--- trunk/libs/chrono/doc/chrono.qbk (original)
+++ trunk/libs/chrono/doc/chrono.qbk 2012-09-08 08:13:09 EDT (Sat, 08 Sep 2012)
@@ -2531,6 +2531,8 @@
 
 This allow to be closer to the standard and to avoid the Boost.System dependency, making possible to have Boost.Chrono as a header-only library.
 
+By default `BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING` is defined.
+
 [endsect] [/section:header_only How to Build Boost.Chrono as a Header Only Library?]
 
 [section:header_only How to Build Boost.Chrono as a Header Only Library?]
@@ -2543,6 +2545,33 @@
 
 [endsect] [/section:header_only How to Build Boost.Chrono as a Header Only Library?]
 
+[section:deprecated_io Deprecated IO]
+
+Version 2.0.0 deprecates the preceding IO features.
+
+These deprecated features will be provided by default up to boost 1.55.
+If you don't want to include the deprecated features you could define `BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0`.
+Since 1.55 these features will not be included any more by default.
+Since this version, if you want to include the deprecated features yet you could define `BOOST_CHRONO_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0`.
+These deprecated features will be only available until boost 1.58, that is you have 1 year and a half to move to the new features.
+
+[endsect]
+[section:version Version]
+
+`BOOST_CHRONO_VERSION` defines the Boost.Chrono version.
+The default version is 1. In this case the following breaking or extending macros are defined if the opposite is not requested:
+
+* `BOOST_CHRONO_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0`
+
+The user can request the version 2 by defining `BOOST_CHRONO_VERSION` to 2. In this case the following breaking or extending macros are defined if the opposite is not requested:
+
+* Breaking change `BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0 `
+
+The default value for `BOOST_THREAD_VERSION` will be changed to 2 since Boost 1.55.
+
+[endsect]
+
+
 [endsect] [/section:conf Configuration Macros]
 
 [endsect] [/section:chrono_hpp Header `<boost/chrono.hpp>`]
@@ -7218,31 +7247,26 @@
 
 
 [//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////]
-
-
-[//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////]
 [section [*Version 2.0.0, December 1, 2012 - 1.52] ]
 
 [*New Features:]
 
 * Enhance chrono I/O
- * [@http://svn.boost.org/trac/boost/ticket/5980 #5980] Take care of the Howard Hinnant [@http://home.roadrunner.com/~hinnant/bloomington/chrono_io.html proposal] which has the advantage to provide I/O for system clocks using the Gregorian Calendar.
- * [@http://svn.boost.org/trac/boost/ticket/5981 #5981] Add i/o state savers.
- * [@http://svn.boost.org/trac/boost/ticket/7058 #7058] Make it work wehn BOOST_NO_EXCEPTIONS is defined.
+ * [@http://svn.boost.org/trac/boost/ticket/5980 #5980] Enhance chrono I/O with H. Hinnant proposal [@http://home.roadrunner.com/~hinnant/bloomington/chrono_io.html proposal] which has the advantage to provide I/O for system clocks using the Gregorian Calendar.
+ * [@http://svn.boost.org/trac/boost/ticket/5981 #5981] Add i/o state savers for duration and time_point formatting state.
     * [@http://svn.boost.org/trac/boost/ticket/7059 #7059] Add low level i/o facilities.
 
 [*Deprecated:]
 
 * The chrono i/o version included in Boost.Chrono 1.2.x has been completly refactored in version 2.0.0
 * chrono I/O: The manipulators __duration_short, __duration_long are depreceated. You should use the parameterized form __duration_fmt or the renamed manipulators __duration_symbol and __duration_prefix instead.
-* chrono I/O: The duraction_punc<> facet is depreceated. You should use the __get_duration_style free function to get the informations and use the duration_units facet for localization purposes.
+* chrono I/O: The __duration_punct<> facet is depreceated. You should use the __get_duration_style free function to get the informations and use the __duration_units facet for localization purposes.
 
 When BOOST_CHRONO_VERSION==2 the preceding deprecated functions are not available.
 
 [*Fixes:]
 
-
-[/* [@http://svn.boost.org/trac/boost/ticket/6094 #6094] 1 secondALPHA should be an invalid input for a duration.]
+* [@http://svn.boost.org/trac/boost/ticket/6871 #6871] chrono_io.hpp: operator<<(ostream& os, ...) modifies the state of os.
 
 [endsect] [/section [*Version 2.0.0] ]
 
@@ -7758,6 +7782,7 @@
 
 * Include Stopwatches.
 * Include chrono::date as defined by Howard Hinnant [@http://home.roadrunner.com/~hinnant/bloomington/date.html here].
+* Add User defined literals for some durations.
 
 [endsect]
 

Modified: trunk/libs/chrono/doc/stopwatches/reference.qbk
==============================================================================
--- trunk/libs/chrono/doc/stopwatches/reference.qbk (original)
+++ trunk/libs/chrono/doc/stopwatches/reference.qbk 2012-09-08 08:13:09 EDT (Sat, 08 Sep 2012)
@@ -1497,9 +1497,9 @@
 
       basic_strict_stopclock();
 
-#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
+ #if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
       explicit basic_strict_stopclock(system::error_code & ec);
-#endif
+ #endif
 
       explicit basic_strict_stopclock(formatter_type const& fmt);
 
@@ -1527,9 +1527,9 @@
       {
       }
 
-#if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
+ #if !defined BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING
       explicit strict_stopclock(system::error_code & ec);
-#endif
+ #endif
       explicit strict_stopclock(formatter_type const& fmt);
       explicit strict_stopclock(const typename Formatter::char_type* fmt);
       explicit strict_stopclock(typename Formatter::string_type const& fmt);


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