2016-10-13 Jonathan Wakely <jwakely@redhat.com>
+ * include/std/chrono (floor): Replace non-constexpr operation.
+ * testsuite/20_util/duration_cast/rounding.cc: Test conversion to
+ durations with floating pointer representations.
+
* src/c++11/compatibility-thread-c++0x.cc (_Bind_simple)
(_Bind_simple_helper, __bind_simple): Restore for ABI compat symbols.
using namespace std::chrono_literals;
using std::chrono::seconds;
+using fp_seconds = std::chrono::duration<float>;
+
static_assert( std::chrono::floor<seconds>(1000ms) == 1s );
static_assert( std::chrono::floor<seconds>(1001ms) == 1s );
static_assert( std::chrono::floor<seconds>(1500ms) == 1s );
static_assert( std::chrono::floor<seconds>(2000ms) == 2s );
static_assert( std::chrono::floor<seconds>(2001ms) == 2s );
static_assert( std::chrono::floor<seconds>(2500ms) == 2s );
+static_assert( std::chrono::floor<fp_seconds>(500ms) == fp_seconds{0.5f} );
static_assert( std::chrono::ceil<seconds>(1000ms) == 1s );
static_assert( std::chrono::ceil<seconds>(1001ms) == 2s );
static_assert( std::chrono::ceil<seconds>(2000ms) == 2s );
static_assert( std::chrono::ceil<seconds>(2001ms) == 3s );
static_assert( std::chrono::ceil<seconds>(2500ms) == 3s );
+static_assert( std::chrono::ceil<fp_seconds>(500ms) == fp_seconds{0.5f} );
static_assert( std::chrono::round<seconds>(1000ms) == 1s );
static_assert( std::chrono::round<seconds>(1001ms) == 1s );