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 month_day_last;
13 // constexpr bool operator==(const month_day& x, const month_day& y) noexcept;
14 // Returns: x.month() == y.month()
16 // constexpr bool operator< (const month_day& x, const month_day& y) noexcept;
17 // Returns: x.month() < y.month()
21 #include <type_traits>
24 #include "test_macros.h"
25 #include "test_comparisons.h"
29 using month
= std::chrono::month
;
30 using month_day_last
= std::chrono::month_day_last
;
32 AssertComparisonsAreNoexcept
<month_day_last
>();
33 AssertComparisonsReturnBool
<month_day_last
>();
35 static_assert( testComparisonsValues
<month_day_last
>(month
{1}, month
{1}), "");
36 static_assert( testComparisonsValues
<month_day_last
>(month
{1}, month
{2}), "");
38 // same day, different months
39 for (unsigned i
= 1; i
<= 12; ++i
)
40 for (unsigned j
= 1; j
<= 12; ++j
)
41 assert(testComparisonsValues
<month_day_last
>(month
{i
}, month
{j
}));