// Copyright 2023 Matt Borland // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #include #if !defined(BOOST_NO_CXX17_HDR_CHARCONV) && (!defined(__clang_major__) || (defined(__clang_major__) && __clang_major__ > 7)) #include #include #include #include #include #include #include #include #include #include template void test() { // Signed 0 char buffer1[64] {}; T v1 = static_cast(-0); auto r1 = std::to_chars(buffer1, buffer1 + sizeof(buffer1) - 1, v1); (void)r1; BOOST_TEST_CSTR_EQ(buffer1, "0"); } int main() { test(); test(); test(); test(); test(); test(); test(); test(); test(); test(); test(); return boost::report_errors(); } #else int main() { return 0; } #endif