Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libcxx/include/__chrono/time_point.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct common_type<chrono::time_point<_Clock, _Duration1>, chrono::time_point<_C

namespace chrono {

template <class _ToDuration, class _Clock, class _Duration>
template <class _ToDuration, class _Clock, class _Duration, __enable_if_t<__is_duration_v<_ToDuration>, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 time_point<_Clock, _ToDuration>
time_point_cast(const time_point<_Clock, _Duration>& __t) {
return time_point<_Clock, _ToDuration>(chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__cxx03/__chrono/time_point.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ common_type<chrono::time_point<_Clock, _Duration1>, chrono::time_point<_Clock, _

namespace chrono {

template <class _ToDuration, class _Clock, class _Duration>
template <class _ToDuration, class _Clock, class _Duration, __enable_if_t<__is_duration<_ToDuration>::value, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI time_point<_Clock, _ToDuration> time_point_cast(const time_point<_Clock, _Duration>& __t) {
return time_point<_Clock, _ToDuration>(chrono::duration_cast<_ToDuration>(__t.time_since_epoch()));
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,19 @@
#include <cassert>
#include <ratio>
#include <type_traits>
#include <utility>

#include "test_macros.h"

template <class T, class = void>
inline constexpr bool has_abs_v = false;

template <class T>
inline constexpr bool has_abs_v<T, decltype((void)std::chrono::abs(std::declval<T>()))> = true;

static_assert(has_abs_v<std::chrono::milliseconds>);
static_assert(!has_abs_v<std::chrono::duration<unsigned>>);

template <class Duration>
void
test(const Duration& f, const Duration& d)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@

#include "test_macros.h"

template <class T, class = void>
inline constexpr bool has_ceil_v = false;

template <class T>
inline constexpr bool has_ceil_v<T, decltype((void)std::chrono::ceil<T>(std::chrono::system_clock::now()))> = true;

static_assert(has_ceil_v<std::chrono::seconds>);
static_assert(!has_ceil_v<int>);

template <class FromDuration, class ToDuration>
void
test(const FromDuration& df, const ToDuration& d)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@

#include "test_macros.h"

template <class T, class = void>
inline constexpr bool has_floor_v = false;

template <class T>
inline constexpr bool has_floor_v<T, decltype((void)std::chrono::floor<T>(std::chrono::system_clock::now()))> = true;

static_assert(has_floor_v<std::chrono::seconds>);
static_assert(!has_floor_v<int>);

template <class FromDuration, class ToDuration>
void
test(const FromDuration& df, const ToDuration& d)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@

#include "test_macros.h"

template <class T, class = void>
inline constexpr bool has_round_v = false;

template <class T>
inline constexpr bool has_round_v<T, decltype((void)std::chrono::round<T>(std::chrono::system_clock::now()))> = true;

static_assert(has_round_v<std::chrono::seconds>);
static_assert(!has_round_v<int>);

template <class FromDuration, class ToDuration>
void
test(const FromDuration& df, const ToDuration& d)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@

#include "test_macros.h"

template <class T, class = void>
struct has_time_point_cast : std::false_type {};

template <class T>
struct has_time_point_cast<T, decltype((void)std::chrono::time_point_cast<T>(std::chrono::system_clock::now()))>
: std::true_type {};

static_assert(has_time_point_cast<std::chrono::seconds>::value, "");
static_assert(!has_time_point_cast<int>::value, "");

template <class FromDuration, class ToDuration>
void
test(const FromDuration& df, const ToDuration& d)
Expand Down

This file was deleted.

Loading