<string> Support
#include <boost/int128/string.hpp>
The following are functions analogous to those found in <string> for builtin integer types.
#include <boost/int128/string.hpp>
namespace boost {
namespace int128 {
// Constrained to T being int128_t or uint128_t.
template <typename T>
std::enable_if_t<std::is_same<T, int128_t>::value || std::is_same<T, uint128_t>::value, std::string>
to_string(const T& value);
// Constrained to T being int128_t or uint128_t.
template <typename T>
std::enable_if_t<std::is_same<T, int128_t>::value || std::is_same<T, uint128_t>::value, std::wstring>
to_wstring(const T& value);
} // namespace int128
} // namespace boost
to_string returns a std::string, and to_wstring returns a std::wstring, containing the decimal(base-10) representation of value.
These functions may throw std::bad_alloc from the constructor of the returned string.
An example of how to use these functions is available on the examples page.