|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r81651 - in branches/release: boost/chrono boost/chrono/detail boost/chrono/detail/no_warning boost/chrono/io boost/chrono/io/utility boost/chrono/io_v1 libs/chrono/src libs/chrono/test/duration libs/chrono/test/io libs/chrono/test/time_point libs/chrono/test/traits
From: vicente.botet_at_[hidden]
Date: 2012-12-01 10:22:35
Author: viboes
Date: 2012-12-01 10:22:34 EST (Sat, 01 Dec 2012)
New Revision: 81651
URL: http://svn.boost.org/trac/boost/changeset/81651
Log:
Merge from trunk
Properties modified:
branches/release/boost/chrono/detail/ (props changed)
branches/release/boost/chrono/io/ (props changed)
branches/release/boost/chrono/io_v1/ (props changed)
branches/release/libs/chrono/src/ (props changed)
branches/release/libs/chrono/test/duration/ (props changed)
branches/release/libs/chrono/test/io/ (props changed)
branches/release/libs/chrono/test/time_point/ (props changed)
branches/release/libs/chrono/test/traits/ (props changed)
Text files modified:
branches/release/boost/chrono/config.hpp | 2
branches/release/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp | 10 ++++
branches/release/boost/chrono/duration.hpp | 7 +-
branches/release/boost/chrono/io/duration_io.hpp | 44 ++++++++---------
branches/release/boost/chrono/io/ios_base_state.hpp | 1
branches/release/boost/chrono/io/time_point_get.hpp | 3 -
branches/release/boost/chrono/io/time_point_io.hpp | 100 +++++++++++----------------------------
branches/release/boost/chrono/io/utility/ios_base_state_ptr.hpp | 9 +--
8 files changed, 67 insertions(+), 109 deletions(-)
Modified: branches/release/boost/chrono/config.hpp
==============================================================================
--- branches/release/boost/chrono/config.hpp (original)
+++ branches/release/boost/chrono/config.hpp 2012-12-01 10:22:34 EST (Sat, 01 Dec 2012)
@@ -130,7 +130,7 @@
#if defined( BOOST_NO_CXX11_NUMERIC_LIMITS )
# define BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW throw()
#else
-#ifdef BOOST_NO_NOEXCEPT
+#ifdef BOOST_NO_CXX11_NOEXCEPT
# define BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW throw()
#else
# define BOOST_CHRONO_LIB_NOEXCEPT_OR_THROW noexcept
Modified: branches/release/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp
==============================================================================
--- branches/release/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp (original)
+++ branches/release/boost/chrono/detail/no_warning/signed_unsigned_cmp.hpp 2012-12-01 10:22:34 EST (Sat, 01 Dec 2012)
@@ -19,6 +19,10 @@
#if defined(__GNUC__) && (__GNUC__ >= 4)
#pragma GCC system_header
+#elif defined __SUNPRO_CC
+#pragma disable_warn
+#elif defined _MSC_VER
+#pragma warning(push, 1)
#endif
namespace boost {
@@ -41,4 +45,10 @@
} // namespace detail
} // namespace chrono
+#if defined __SUNPRO_CC
+#pragma enable_warn
+#elif defined _MSC_VER
+#pragma warning(pop)
+#endif
+
#endif // BOOST_CHRONO_DETAIL_NO_WARNING_SIGNED_UNSIGNED_CMP_HPP
Modified: branches/release/boost/chrono/duration.hpp
==============================================================================
--- branches/release/boost/chrono/duration.hpp (original)
+++ branches/release/boost/chrono/duration.hpp 2012-12-01 10:22:34 EST (Sat, 01 Dec 2012)
@@ -417,7 +417,7 @@
namespace chrono {
template <class Rep, class Period>
- class duration
+ class BOOST_SYMBOL_VISIBLE duration
{
//BOOST_CHRONO_STATIC_ASSERT(boost::is_integral<Rep>::value, BOOST_CHRONO_A_DURATION_REPRESENTATION_MUST_BE_INTEGRAL, ());
BOOST_CHRONO_STATIC_ASSERT(!boost::chrono::detail::is_duration<Rep>::value,
@@ -436,7 +436,7 @@
BOOST_CONSTEXPR
duration() : rep_(duration_values<rep>::zero()) { }
template <class Rep2>
- BOOST_CONSTEXPR
+ BOOST_SYMBOL_VISIBLE inline BOOST_CONSTEXPR
explicit duration(const Rep2& r
, typename boost::enable_if <
mpl::and_ <
@@ -452,8 +452,7 @@
>::type* = 0
) : rep_(r) { }
//~duration() {} //= default;
- //BOOST_CONSTEXPR
- //duration(const duration& rhs) : rep_(rhs.rep_) {} // = default;
+// BOOST_CONSTEXPR duration(const duration& rhs) : rep_(rhs.rep_) {} // = default;
duration& operator=(const duration& rhs) // = default;
{
if (&rhs != this) rep_= rhs.rep_;
Modified: branches/release/boost/chrono/io/duration_io.hpp
==============================================================================
--- branches/release/boost/chrono/io/duration_io.hpp (original)
+++ branches/release/boost/chrono/io/duration_io.hpp 2012-12-01 10:22:34 EST (Sat, 01 Dec 2012)
@@ -10,13 +10,14 @@
#ifndef BOOST_CHRONO_IO_DURATION_IO_HPP
#define BOOST_CHRONO_IO_DURATION_IO_HPP
-#include <boost/chrono/chrono.hpp>
+#include <boost/chrono/duration.hpp>
#include <boost/ratio/ratio_io.hpp>
#include <boost/chrono/io/duration_style.hpp>
#include <boost/chrono/io/ios_base_state.hpp>
#include <boost/chrono/io/duration_put.hpp>
#include <boost/chrono/io/duration_get.hpp>
#include <boost/chrono/io/utility/manip_base.hpp>
+#include <boost/detail/no_exceptions_support.hpp>
#include <locale>
#include <iostream>
@@ -104,6 +105,8 @@
}
private:
+ duration_style_io_saver& operator=(duration_style_io_saver const& rhs) ;
+
state_type& s_save_;
aspect_type a_save_;
};
@@ -119,15 +122,11 @@
operator<<(std::basic_ostream<CharT, Traits>& os, const duration<Rep, Period>& d)
{
typedef std::basic_string<CharT, Traits> string_type;
-#ifndef BOOST_NO_EXCEPTIONS
bool failed = false;
- try // BOOST_NO_EXCEPTIONS protected
-#endif
+ BOOST_TRY
{
std::ios_base::iostate err = std::ios_base::goodbit;
-#ifndef BOOST_NO_EXCEPTIONS
- try // BOOST_NO_EXCEPTIONS protected
-#endif
+ BOOST_TRY
{
typename std::basic_ostream<CharT, Traits>::sentry opfx(os);
if (bool(opfx))
@@ -146,31 +145,30 @@
os.width(0);
}
}
-#ifndef BOOST_NO_EXCEPTIONS
- catch (...) // BOOST_NO_EXCEPTIONS protected
+ BOOST_CATCH(...)
{
bool flag = false;
- try // BOOST_NO_EXCEPTIONS protected
+ BOOST_TRY
{
os.setstate(std::ios_base::failbit);
}
- catch (std::ios_base::failure ) // BOOST_NO_EXCEPTIONS protected
+ BOOST_CATCH (std::ios_base::failure )
{
flag = true;
}
+ BOOST_CATCH_END
if (flag) throw;
}
-#endif
+ BOOST_CATCH_END
if (err) os.setstate(err);
return os;
}
-#ifndef BOOST_NO_EXCEPTIONS
- catch (...) // BOOST_NO_EXCEPTIONS protected
+ BOOST_CATCH(...)
{
failed = true;
}
+ BOOST_CATCH_END
if (failed) os.setstate(std::ios_base::failbit | std::ios_base::badbit);
-#endif
return os;
}
@@ -186,9 +184,7 @@
{
std::ios_base::iostate err = std::ios_base::goodbit;
-#ifndef BOOST_NO_EXCEPTIONS
- try // BOOST_NO_EXCEPTIONS protected
-#endif
+ BOOST_TRY
{
typename std::basic_istream<CharT, Traits>::sentry ipfx(is);
if (bool(ipfx))
@@ -204,21 +200,21 @@
}
}
}
-#ifndef BOOST_NO_EXCEPTIONS
- catch (...) // BOOST_NO_EXCEPTIONS protected
+ BOOST_CATCH (...)
{
bool flag = false;
- try // BOOST_NO_EXCEPTIONS protected
+ BOOST_TRY
{
is.setstate(std::ios_base::failbit);
}
- catch (std::ios_base::failure ) // BOOST_NO_EXCEPTIONS protected
+ BOOST_CATCH (std::ios_base::failure )
{
flag = true;
}
- if (flag) throw; // BOOST_NO_EXCEPTIONS protected
+ BOOST_CATCH_END
+ if (flag) { BOOST_RETHROW }
}
-#endif
+ BOOST_CATCH_END
if (err) is.setstate(err);
return is;
}
Modified: branches/release/boost/chrono/io/ios_base_state.hpp
==============================================================================
--- branches/release/boost/chrono/io/ios_base_state.hpp (original)
+++ branches/release/boost/chrono/io/ios_base_state.hpp 2012-12-01 10:22:34 EST (Sat, 01 Dec 2012)
@@ -23,6 +23,7 @@
class fmt_masks : public ios_flags<fmt_masks>
{
typedef ios_flags<fmt_masks> base_type;
+ fmt_masks& operator=(fmt_masks const& rhs) ;
public:
fmt_masks(std::ios_base& ios): base_type(ios) {}
Modified: branches/release/boost/chrono/io/time_point_get.hpp
==============================================================================
--- branches/release/boost/chrono/io/time_point_get.hpp (original)
+++ branches/release/boost/chrono/io/time_point_get.hpp 2012-12-01 10:22:34 EST (Sat, 01 Dec 2012)
@@ -126,7 +126,6 @@
err = std::ios_base::goodbit;
while (pattern != pat_end && err == std::ios_base::goodbit)
{
- //std::cerr << __FILE__ << ":" << __LINE__ << " err " << err << std::endl;
if (s == end)
{
err |= std::ios_base::eofbit;
@@ -151,7 +150,6 @@
}
duration_found = true;
s = get_duration(s, end, ios, err, d);
- //std::cerr << __FILE__ << ":" << __LINE__ << " err " << err << std::endl;
if (err & (std::ios_base::badbit | std::ios_base::failbit))
{
return s;
@@ -167,7 +165,6 @@
}
epoch_found = true;
s = get_epoch<Clock> (facet, s, end, ios, err);
- //std::cerr << __FILE__ << ":" << __LINE__ << " err " << err << std::endl;
if (err & (std::ios_base::badbit | std::ios_base::failbit))
{
return s;
Modified: branches/release/boost/chrono/io/time_point_io.hpp
==============================================================================
--- branches/release/boost/chrono/io/time_point_io.hpp (original)
+++ branches/release/boost/chrono/io/time_point_io.hpp 2012-12-01 10:22:34 EST (Sat, 01 Dec 2012)
@@ -24,10 +24,11 @@
#include <boost/chrono/io/duration_io.hpp>
#include <boost/chrono/io/ios_base_state.hpp>
#include <boost/chrono/io/utility/manip_base.hpp>
-#include <boost/chrono/chrono.hpp>
+#include <boost/chrono/time_point.hpp>
#include <boost/chrono/clock_string.hpp>
#include <boost/chrono/round.hpp>
#include <boost/chrono/detail/scan_keyword.hpp>
+#include <boost/detail/no_exceptions_support.hpp>
#include <cstring>
#include <locale>
#include <string.h>
@@ -520,6 +521,8 @@
set_timezone(s_save_, a_save_);
}
private:
+ timezone_io_saver& operator=(timezone_io_saver const& rhs) ;
+
state_type& s_save_;
aspect_type a_save_;
};
@@ -539,15 +542,11 @@
{
typedef std::basic_string<CharT, Traits> string_type;
-#ifndef BOOST_NO_EXCEPTIONS
bool failed = false;
- try // BOOST_NO_EXCEPTIONS protected
-#endif
+ BOOST_TRY
{
std::ios_base::iostate err = std::ios_base::goodbit;
-#ifndef BOOST_NO_EXCEPTIONS
- try // BOOST_NO_EXCEPTIONS protected
-#endif
+ BOOST_TRY
{
typename std::basic_ostream<CharT, Traits>::sentry opfx(os);
if (bool(opfx))
@@ -569,31 +568,30 @@
os.width(0);
}
}
-#ifndef BOOST_NO_EXCEPTIONS
- catch (...) // BOOST_NO_EXCEPTIONS protected
+ BOOST_CATCH (...)
{
bool flag = false;
- try // BOOST_NO_EXCEPTIONS protected
+ BOOST_TRY
{
os.setstate(std::ios_base::failbit);
}
- catch (std::ios_base::failure ) // BOOST_NO_EXCEPTIONS protected
+ BOOST_CATCH (std::ios_base::failure )
{
flag = true;
}
+ BOOST_CATCH_END
if (flag) throw;
}
-#endif
+ BOOST_CATCH_END
if (err) os.setstate(err);
return os;
}
-#ifndef BOOST_NO_EXCEPTIONS
- catch (...) // BOOST_NO_EXCEPTIONS protected
+ BOOST_CATCH (...)
{
failed = true;
}
+ BOOST_CATCH_END
if (failed) os.setstate(std::ios_base::failbit | std::ios_base::badbit);
-#endif
return os;
}
@@ -601,53 +599,40 @@
std::basic_istream<CharT, Traits>&
operator>>(std::basic_istream<CharT, Traits>& is, time_point<Clock, Duration>& tp)
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
std::ios_base::iostate err = std::ios_base::goodbit;
-#ifndef BOOST_NO_EXCEPTIONS
- try // BOOST_NO_EXCEPTIONS protected
-#endif
+ BOOST_TRY
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
typename std::basic_istream<CharT, Traits>::sentry ipfx(is);
if (bool(ipfx))
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
if (!std::has_facet<time_point_get<CharT> >(is.getloc()))
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
time_point_get<CharT> ().get(is, std::istreambuf_iterator<CharT, Traits>(), is, err, tp);
}
else
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
std::use_facet<time_point_get<CharT> >(is.getloc()).get(is, std::istreambuf_iterator<CharT, Traits>(), is,
err, tp);
}
}
}
-#ifndef BOOST_NO_EXCEPTIONS
- catch (...) // BOOST_NO_EXCEPTIONS protected
+ BOOST_CATCH (...)
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
bool flag = false;
- try
+ BOOST_TRY
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
is.setstate(std::ios_base::failbit);
}
- catch (std::ios_base::failure ) // BOOST_NO_EXCEPTIONS protected
+ BOOST_CATCH (std::ios_base::failure )
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
flag = true;
}
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
+ BOOST_CATCH_END
if (flag) throw;
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
}
-#endif
+ BOOST_CATCH_END
if (err) is.setstate(err);
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
return is;
}
@@ -715,21 +700,17 @@
} // detail
#if defined BOOST_CHRONO_PROVIDES_DATE_IO_FOR_SYSTEM_CLOCK_TIME_POINT
+
template <class CharT, class Traits, class Duration>
std::basic_ostream<CharT, Traits>&
operator<<(std::basic_ostream<CharT, Traits>& os, const time_point<system_clock, Duration>& tp)
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
typename std::basic_ostream<CharT, Traits>::sentry ok(os);
if (bool(ok))
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
bool failed = false;
-#ifndef BOOST_NO_EXCEPTIONS
- try // BOOST_NO_EXCEPTIONS protected
-#endif
+ BOOST_TRY
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
const CharT* pb = 0; //nullptr;
const CharT* pe = pb;
std::basic_string<CharT> fmt = get_time_fmt<CharT> (os);
@@ -742,7 +723,6 @@
std::tm tm;
if (tz == timezone::local)
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
#if defined BOOST_WINDOWS && ! defined(__CYGWIN__)
std::tm *tmp = 0;
if ((tmp=localtime(&t)) == 0)
@@ -754,7 +734,6 @@
}
else
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
#if defined BOOST_WINDOWS && ! defined(__CYGWIN__)
std::tm *tmp = 0;
if((tmp = gmtime(&t)) == 0)
@@ -765,14 +744,11 @@
#endif
}
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
if (!failed)
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
const std::time_put<CharT>& tpf = std::use_facet<std::time_put<CharT> >(loc);
if (pb == pe)
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
CharT pattern[] =
{ '%', 'Y', '-', '%', 'm', '-', '%', 'd', ' ', '%', 'H', ':', '%', 'M', ':' };
pb = pattern;
@@ -780,34 +756,23 @@
failed = tpf.put(os, os, os.fill(), &tm, pb, pe).failed();
if (!failed)
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
duration<double> d = tp - system_clock::from_time_t(t) + seconds(tm.tm_sec);
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
if (d.count() < 10) os << CharT('0');
//if (! os.good()) {
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
// throw "exception";
//}
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
std::ios::fmtflags flgs = os.flags();
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
os.setf(std::ios::fixed, std::ios::floatfield);
//if (! os.good()) {
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
//throw "exception";
//}
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< " " << d.count() << std::endl;
os << d.count();
//if (! os.good()) {
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
//throw "exception";
//}
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< " " << d.count() << std::endl;
os.flags(flgs);
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
if (tz == timezone::local)
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
CharT sub_pattern[] =
{ ' ', '%', 'z' };
pb = sub_pattern;
@@ -816,36 +781,28 @@
}
else
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
CharT sub_pattern[] =
{ ' ', '+', '0', '0', '0', '0', 0 };
os << sub_pattern;
}
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
}
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
}
else
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
failed = tpf.put(os, os, os.fill(), &tm, pb, pe).failed();
}
}
}
-#ifndef BOOST_NO_EXCEPTIONS
- catch (...) // BOOST_NO_EXCEPTIONS protected
+ BOOST_CATCH (...)
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
failed = true;
}
-#endif
+ BOOST_CATCH_END
if (failed)
{
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
os.setstate(std::ios_base::failbit | std::ios_base::badbit);
}
}
- //std::cerr << __FILE__ << "[" << __LINE__ << "]"<< std::endl;
return os;
}
#endif
@@ -913,6 +870,7 @@
} // detail
#if defined BOOST_CHRONO_PROVIDES_DATE_IO_FOR_SYSTEM_CLOCK_TIME_POINT
+
template <class CharT, class Traits, class Duration>
std::basic_istream<CharT, Traits>&
operator>>(std::basic_istream<CharT, Traits>& is, time_point<system_clock, Duration>& tp)
@@ -921,9 +879,7 @@
if (bool(ok))
{
std::ios_base::iostate err = std::ios_base::goodbit;
-#ifndef BOOST_NO_EXCEPTIONS
- try
-#endif
+ BOOST_TRY
{
const CharT* pb = 0; //nullptr;
const CharT* pe = pb;
@@ -1039,16 +995,16 @@
);
}
}
-#ifndef BOOST_NO_EXCEPTIONS
- catch (...) // BOOST_NO_EXCEPTIONS protected
+ BOOST_CATCH (...)
{
err |= std::ios_base::badbit | std::ios_base::failbit;
}
-#endif
+ BOOST_CATCH_END
exit: is.setstate(err);
}
return is;
}
+
#endif
#endif //UTC
} // chrono
Modified: branches/release/boost/chrono/io/utility/ios_base_state_ptr.hpp
==============================================================================
--- branches/release/boost/chrono/io/utility/ios_base_state_ptr.hpp (original)
+++ branches/release/boost/chrono/io/utility/ios_base_state_ptr.hpp 2012-12-01 10:22:34 EST (Sat, 01 Dec 2012)
@@ -53,12 +53,10 @@
{
xalloc_key_initializer()
{
- std::cout << __FILE__ << ":" << __LINE__ << std::endl;
if (!detail::xalloc_key_holder<T>::initialized)
{
detail::xalloc_key_holder<T>::value = std::ios_base::xalloc();
detail::xalloc_key_holder<T>::initialized = true;
- std::cout << __FILE__ << ":" << __LINE__ << " " << detail::xalloc_key_holder<T>::value <<std::endl;
}
}
};
@@ -68,6 +66,8 @@
template <typename Final, typename T>
class ios_state_ptr
{
+ ios_state_ptr& operator=(ios_state_ptr const& rhs) ;
+
public:
/**
* The pointee type
@@ -81,8 +81,6 @@
explicit ios_state_ptr(std::ios_base& ios) :
ios_(ios)
{
- std::cout << __FILE__ << ":" << __LINE__ << std::endl;
-
}
/**
* Nothing to do as xalloc index can not be removed.
@@ -280,6 +278,7 @@
}
}
+
protected:
std::ios_base& ios_;
//static detail::xalloc_key_initializer<Final> xalloc_key_initializer_;
@@ -338,7 +337,6 @@
~ios_flags()
{
}
-
/**
* @Returns The format control information.
*/
@@ -422,6 +420,7 @@
{
return detail::xalloc_key_holder<Final>::value;
}
+ ios_flags& operator=(ios_flags const& rhs) ;
std::ios_base& ios_;
//static detail::xalloc_key_initializer<Final> xalloc_key_initializer_;
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