1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
10 // UNSUPPORTED: no-filesystem, no-localization, no-tzdb
12 // XFAIL: libcpp-has-no-incomplete-tzdb
13 // XFAIL: availability-tzdb-missing
15 // TODO TZDB Enable tests
16 // UNSUPPORTED: c++20, c++23, c++26
22 // const_iterator begin() const noexcept;
23 // const_iterator end() const noexcept;
25 // const_iterator cbegin() const noexcept;
26 // const_iterator cend() const noexcept;
32 int main(int, char**) {
33 const std::chrono::tzdb_list
& list
= std::chrono::get_tzdb_list();
34 using it
= std::chrono::tzdb_list::const_iterator
;
36 static_assert(noexcept(list
.begin()));
37 static_assert(noexcept(list
.end()));
38 static_assert(noexcept(list
.cbegin()));
39 static_assert(noexcept(list
.cend()));
41 std::same_as
<it
> auto begin
= list
.begin();
42 std::same_as
<it
> auto end
= list
.end();
43 assert(std::distance(begin
, end
) == 1);
45 std::same_as
<it
> auto cbegin
= list
.cbegin();
46 assert(begin
== cbegin
);
48 std::same_as
<it
> auto cend
= list
.cend();