sparrow 1.4.0
C++20 idiomatic APIs for the Apache Arrow Columnar Format
Loading...
Searching...
No Matches
int128_t.hpp File Reference

Support for int128_t, uint128_t types. More...

#include <sstream>
#include <stdint.h>
#include <limits>
#include <type_traits>
Include dependency graph for int128_t.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  primesum::prt::numeric_limits< T >
 
struct  primesum::prt::numeric_limits< int128_t >
 
struct  primesum::prt::numeric_limits< uint128_t >
 
struct  primesum::prt::is_integral< T >
 
struct  primesum::prt::is_signed< T >
 
struct  primesum::prt::is_unsigned< T >
 

Namespaces

namespace  primesum
 
namespace  primesum::prt
 Portable namespace, includes functions which (unlike the versions form the C++ standard library) work with the int128_t and uint128_t types (2014).
 

Functions

std::ostream & operator<< (std::ostream &stream, primesum::uint128_t n)
 The __int128_t type (GCC/Clang) is not well supported by the C++ standard library (in 2016) so we have to define some functions ourselves.
 
std::ostream & operator<< (std::ostream &stream, primesum::int128_t n)
 
std::string primesum::to_string (const uint128_t &n)
 
std::string primesum::to_string (const int128_t &n)
 

Detailed Description

Support for int128_t, uint128_t types.

Copyright (C) 2018 Kim Walisch, kim.w.nosp@m.alis.nosp@m.ch@gm.nosp@m.ail..nosp@m.com

This file is distributed under the BSD License. See the COPYING file in the top level directory.

Definition in file int128_t.hpp.

Function Documentation

◆ operator<<() [1/2]

std::ostream & operator<< ( std::ostream & stream,
primesum::int128_t n )
inline

Definition at line 66 of file int128_t.hpp.

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream & stream,
primesum::uint128_t n )
inline

The __int128_t type (GCC/Clang) is not well supported by the C++ standard library (in 2016) so we have to define some functions ourselves.

We also define typedefs so we can use int128_t instead of __int128_t. Once this is done int128_t can be used like a regular integer type.

Definition at line 48 of file int128_t.hpp.