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
13 // struct to_chars_result
14 // friend bool operator==(const to_chars_result&, const to_chars_result&) = default;
17 // The types to_chars_result and from_chars_result have the data members and
18 // special members specified above. They have no base classes or members other
19 // than those specified.
27 #include "test_macros.h"
29 constexpr bool test() {
30 std::to_chars_result lhs
{nullptr, std::errc
{}};
32 std::to_chars_result rhs
{nullptr, std::errc
{}};
34 assert(!(lhs
!= rhs
));
37 static_assert(std::is_same_v
<decltype(ptr
), char*>);
38 assert(ptr
== lhs
.ptr
);
39 static_assert(std::is_same_v
<decltype(ec
), std::errc
>);
45 int main(int, char**) {
47 static_assert(std::equality_comparable
<std::to_chars_result
>);
48 static_assert(!std::totally_ordered
<std::to_chars_result
>);
49 static_assert(!std::three_way_comparable
<std::to_chars_result
>);
53 static_assert(test());