Skip to content

Commit 5c09a5d

Browse files
address comments
1 parent 5fcfd58 commit 5c09a5d

File tree

5 files changed

+26
-4
lines changed

5 files changed

+26
-4
lines changed

libcxx/docs/ReleaseNotes/22.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ Implemented Papers
4141
- P2321R2: ``zip`` (`Github <https://llvm.org/PR105169>`__) (The paper is partially implemented. ``zip_transform_view``
4242
is implemented in this release)
4343
- P3168R2: Give ``std::optional`` Range Support (`Github <https://llvm.org/PR105430>`__)
44-
- P0355R7: ``std::chrono::is_clock`` and ``std::chrono::is_clock_v`` (`Github <https://llvm.org/PR160607>` __)
45-
(The paper is partially implemented. ``is_clock`` and ``is_clock_v`` is implemented in this release)
4644

4745
Improvements and New Features
4846
-----------------------------

libcxx/include/__chrono/is_clock.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111
#define _LIBCPP___CHRONO_IS_CLOCK_H
1212

1313
#include <__config>
14+
#include <__type_traits/integral_constant.h>
1415

1516
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1617
# pragma GCC system_header
1718
#endif
1819

1920
#if _LIBCPP_STD_VER >= 20
2021

21-
# include <__type_traits/integral_constant.h>
22-
2322
_LIBCPP_BEGIN_NAMESPACE_STD
2423

2524
namespace chrono {

libcxx/include/chrono

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ template <class ToDuration, class Rep, class Period>
218218
template <class ToDuration, class Rep, class Period>
219219
constexpr ToDuration round(const duration<Rep, Period>& d); // C++17
220220
221+
template <class T> struct is_clock; // C++20
222+
template <class T> inline constexpr bool is_clock_v = is_clock<T>::value; // C++20
223+
221224
// duration I/O
222225
template<class charT, class traits, class Rep, class Period> // C++20
223226
basic_ostream<charT, traits>&
File renamed without changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
// REQUIRES: std-at-least-c++20
10+
11+
#include <chrono>
12+
#include <ratio>
13+
14+
namespace std::chrono {
15+
// try adding specializations to is_clock
16+
template <>
17+
struct is_clock<int> : std::false_type {}; // expected-error@*:* {{'is_clock' cannot be specialized}}
18+
19+
template <>
20+
constexpr bool is_clock_v<float> = false; // expected-error@*:* {{'is_clock_v' cannot be specialized}}
21+
22+
}

0 commit comments

Comments
 (0)