1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 10 11 // <chrono> 12 // class month_day_last; 13 14 // constexpr bool operator==(const month_day& x, const month_day& y) noexcept; 15 // Returns: x.month() == y.month() 16 // 17 // constexpr bool operator< (const month_day& x, const month_day& y) noexcept; 18 // Returns: x.month() < y.month() 19 20 21 #include <chrono> 22 #include <type_traits> 23 #include <cassert> 24 25 #include "test_macros.h" 26 #include "test_comparisons.h" 27 28 int main() 29 { 30 using month = std::chrono::month; 31 using month_day_last = std::chrono::month_day_last; 32 33 AssertComparisons6AreNoexcept<month_day_last>(); 34 AssertComparisons6ReturnBool<month_day_last>(); 35 36 static_assert( testComparisons6Values<month_day_last>(month{1}, month{1}), ""); 37 static_assert( testComparisons6Values<month_day_last>(month{1}, month{2}), ""); 38 39 // same day, different months 40 for (unsigned i = 1; i < 12; ++i) 41 for (unsigned j = 1; j < 12; ++j) 42 assert((testComparisons6Values<month_day_last>(month{i}, month{j}))); 43 } 44