| 1 | // { dg-do compile { target c++20 } } |
| 2 | // { dg-require-effective-target cxx11_abi } |
| 3 | |
| 4 | #include <chrono> |
| 5 | |
| 6 | using namespace std::chrono; |
| 7 | |
| 8 | static_assert( std::is_default_constructible_v<zoned_time<seconds>> ); |
| 9 | static_assert( std::is_copy_constructible_v<zoned_time<seconds>> ); |
| 10 | static_assert( std::is_copy_assignable_v<zoned_time<seconds>> ); |
| 11 | static_assert( std::is_move_constructible_v<zoned_time<seconds>> ); |
| 12 | static_assert( std::is_move_assignable_v<zoned_time<seconds>> ); |
| 13 | static_assert( std::is_destructible_v<zoned_time<seconds>> ); |
| 14 | |
| 15 | static_assert( std::is_same_v<zoned_time<seconds>::duration, seconds> ); |
| 16 | static_assert( std::is_same_v<zoned_time<nanoseconds>::duration, nanoseconds> ); |
| 17 | static_assert( std::is_same_v<zoned_time<minutes>::duration, seconds> ); |
| 18 | |
| 19 | extern zoned_time<minutes> z; |
| 20 | static_assert( std::is_same_v<decltype(z == z), bool> ); |
| 21 | |
| 22 | // requires zoned_traits<time_zone*>::default_zone(). |
| 23 | static_assert( ! std::is_default_constructible_v<zoned_time<seconds, time_zone*>> ); |
| 24 | // requires zoned_traits<time_zone*>::locate_zone(string_view). |
| 25 | static_assert( ! std::is_constructible_v<zoned_time<seconds, time_zone*>, |
| 26 | std::string_view> ); |