<iostream>
The following stream operators are available and work similar to built-in integer types.
#include <boost/int128/iostream.hpp>
namespace boost {
namespace int128 {
template <typename charT, typename traits>
std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const int128_t& v);
template <typename charT, typename traits>
std::basic_istream<charT, traits>& operator>>(std::basic_istream<charT, traits>& is, int128_t& v);
template <typename charT, typename traits>
std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const uint128_t& v);
template <typename charT, typename traits>
std::basic_istream<charT, traits>& operator>>(std::basic_istream<charT, traits>& is, uint128_t& v);
} // namespace int128
} // namespace boost
Flags
The following flags from <ios> are supported for both streaming directions:
-
std::oct- Octal Numbers -
std::dec- Decimal Numbers -
std::hex- Hexadecimal Numbers -
std::uppercase- Upper Case Formatting (e.g. 0XFFFF) -
std::nouppercase- Lower Case Formatting (e.g. 0xffff)
See the IO streaming example for usage demonstrations.