-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<chrono>: Partially implement P0355R7 (#323)
Co-authored-by: Curtis Jacques Bezault <[email protected]> Co-authored-by: MattStephanson <[email protected]> Co-authored-by: mnatsuhara <[email protected]> Co-authored-by: Stephan T. Lavavej <[email protected]>
- Loading branch information
1 parent
c319a7b
commit 6779b61
Showing
16 changed files
with
3,048 additions
and
407 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
tests/std/tests/P0355R7_calendars_and_time_zones_clocks/env.lst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
RUNALL_INCLUDE ..\usual_latest_matrix.lst |
86 changes: 86 additions & 0 deletions
86
tests/std/tests/P0355R7_calendars_and_time_zones_clocks/test.compile.pass.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
#include <chrono> | ||
|
||
using namespace std::chrono; | ||
|
||
struct not_a_clock { | ||
bool rep(); | ||
static char period; | ||
int duration(); | ||
static float time_point; | ||
using is_steady = long; | ||
static int now; | ||
}; | ||
|
||
struct real_fake_clock { | ||
using rep = bool; | ||
using period = char; | ||
using duration = float; | ||
using time_point = int; | ||
static long is_steady; | ||
static short now(); | ||
}; | ||
|
||
struct no_rep { | ||
using period = char; | ||
using duration = float; | ||
using time_point = int; | ||
static long is_steady; | ||
static short now(); | ||
}; | ||
|
||
struct no_period { | ||
using rep = bool; | ||
using duration = float; | ||
using time_point = int; | ||
static long is_steady; | ||
static short now(); | ||
}; | ||
|
||
struct no_duration { | ||
using rep = bool; | ||
using period = char; | ||
using time_point = int; | ||
static long is_steady; | ||
static short now(); | ||
}; | ||
|
||
struct no_time_point { | ||
using rep = bool; | ||
using period = char; | ||
using duration = float; | ||
static long is_steady; | ||
static short now(); | ||
}; | ||
|
||
struct no_steady { | ||
using rep = bool; | ||
using period = char; | ||
using duration = float; | ||
using time_point = int; | ||
static short now(); | ||
}; | ||
|
||
struct no_now { | ||
using rep = bool; | ||
using period = char; | ||
using duration = float; | ||
using time_point = int; | ||
static long is_steady; | ||
}; | ||
|
||
static_assert(is_clock<steady_clock>::value, "steady_clock is not a clock"); | ||
static_assert(is_clock_v<steady_clock>, "steady_clock is not a clock"); | ||
static_assert(is_clock_v<real_fake_clock>, "real_fake_clock is not a clock"); | ||
static_assert(!is_clock_v<not_a_clock>, "not_a_clock is a clock"); | ||
|
||
static_assert(!is_clock_v<no_rep>, "no_rep is a clock"); | ||
static_assert(!is_clock_v<no_period>, "no_period is a clock"); | ||
static_assert(!is_clock_v<no_duration>, "no_duration is a clock"); | ||
static_assert(!is_clock_v<no_time_point>, "no_time_point is a clock"); | ||
static_assert(!is_clock_v<no_steady>, "no_steady is a clock"); | ||
static_assert(!is_clock_v<no_now>, "no_now is a clock"); | ||
|
||
int main() {} // COMPILE-ONLY |
4 changes: 4 additions & 0 deletions
4
tests/std/tests/P0355R7_calendars_and_time_zones_dates/env.lst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
RUNALL_INCLUDE ..\usual_latest_matrix.lst |
Oops, something went wrong.