|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r74693 - trunk/libs/chrono/example
From: vicente.botet_at_[hidden]
Date: 2011-10-04 08:31:16
Author: viboes
Date: 2011-10-04 08:31:15 EDT (Tue, 04 Oct 2011)
New Revision: 74693
URL: http://svn.boost.org/trac/boost/changeset/74693
Log:
Chrono: replace deprecated duration_short/duration_long. undef BOOST_CHRONO_IO_V1_DONT_PROVIDE_DEPRECATED is this will when deprecated
Text files modified:
trunk/libs/chrono/example/french.cpp | 7 ++++++-
trunk/libs/chrono/example/io_ex1.cpp | 4 ++--
2 files changed, 8 insertions(+), 3 deletions(-)
Modified: trunk/libs/chrono/example/french.cpp
==============================================================================
--- trunk/libs/chrono/example/french.cpp (original)
+++ trunk/libs/chrono/example/french.cpp 2011-10-04 08:31:15 EDT (Tue, 04 Oct 2011)
@@ -7,6 +7,10 @@
// Adapted to Boost from the original Hawards's code
+#if defined BOOST_CHRONO_IO_V1_DONT_PROVIDE_DEPRECATED
+#undef BOOST_CHRONO_IO_V1_DONT_PROVIDE_DEPRECATED
+#endif
+
#include <boost/chrono/chrono_io.hpp>
#include <boost/chrono/process_cpu_clocks.hpp>
#include <boost/chrono/thread_clock.hpp>
@@ -22,7 +26,7 @@
cout.imbue(locale(locale(), new duration_punct<char>
(
- duration_punct<char>::use_long,
+ duration_style::prefix,
"secondes", "minutes", "heures",
"s", "m", "h"
)));
@@ -31,4 +35,5 @@
seconds s(15);
milliseconds ms(763);
cout << h << ", " << m << ", " << s << " et " << ms << '\n';
+ return 0;
}
Modified: trunk/libs/chrono/example/io_ex1.cpp
==============================================================================
--- trunk/libs/chrono/example/io_ex1.cpp (original)
+++ trunk/libs/chrono/example/io_ex1.cpp 2011-10-04 08:31:15 EDT (Tue, 04 Oct 2011)
@@ -37,7 +37,7 @@
<< ClockTick(3) + nanoseconds(10) << '\n';
cout << "\nSet cout to use short names:\n";
- cout << duration_short;
+ cout << duration_fmt(duration_style::symbol);
cout << "milliseconds(3) + microseconds(10) = "
<< milliseconds(3) + microseconds(10) << '\n';
@@ -53,7 +53,7 @@
#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
cout << "steady_clock::now() = " << steady_clock::now() << '\n';
#endif
- cout << "\nSet cout to use long names:\n" << duration_long
+ cout << "\nSet cout to use long names:\n" << cout << duration_fmt(duration_style::prefix)
<< "high_resolution_clock::now() = " << high_resolution_clock::now() << '\n';
#if defined(BOOST_CHRONO_HAS_THREAD_CLOCK)
cout << "\nthread_clock::now() = " << thread_clock::now() << '\n';
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