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 //===----------------------------------------------------------------------===//
8 // UNSUPPORTED: c++03, c++11, c++14, c++17
11 // class weekday_last;
13 // explicit constexpr weekday_last(const chrono::weekday& wd) noexcept;
15 // Effects: Constructs an object of type weekday_last by initializing wd_ with wd.
17 // constexpr chrono::weekday weekday() const noexcept;
18 // constexpr bool ok() const noexcept;
21 #include <type_traits>
24 #include "test_macros.h"
28 using weekday
= std::chrono::weekday
;
29 using weekday_last
= std::chrono::weekday_last
;
31 ASSERT_NOEXCEPT(weekday_last
{weekday
{}});
33 constexpr weekday_last wdl0
{weekday
{}};
34 static_assert( wdl0
.weekday() == weekday
{}, "");
35 static_assert( wdl0
.ok(), "");
37 constexpr weekday_last wdl1
{weekday
{1}};
38 static_assert( wdl1
.weekday() == weekday
{1}, "");
39 static_assert( wdl1
.ok(), "");
41 for (unsigned i
= 0; i
<= 255; ++i
)
43 weekday_last wdl
{weekday
{i
}};
44 assert(wdl
.weekday() == weekday
{i
});