Files
charconv/test/to_chars.cpp
2022-12-29 19:41:33 +02:00

20 lines
486 B
C++

// Copyright 2022 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/charconv.hpp>
#include <boost/core/lightweight_test.hpp>
#include <cstring>
int main()
{
char buffer[ 32 ] = {};
int v = 1048576;
auto r = boost::charconv::to_chars( buffer, buffer + sizeof( buffer ) - 1, v );
BOOST_TEST_EQ( r.ec, 0 ) && BOOST_TEST_CSTR_EQ( buffer, "1048576" );
return boost::report_errors();
}