![]() |
C++ Library Extensions 2022.12.09
To help learn modern C++ programming
|
#include <iostream>
#include <type_traits>
#include <limits>
#include <string>
#include <sstream>
#include <iomanip>
#include <cstddef>
#include <bitset>
#include <cmath>
#include <concepts>
#include <bit>
Go to the source code of this file.
Namespaces | |
namespace | cpg |
Includes subnamespace conversion. | |
namespace | cpg::bitwise |
namespace | cpg::bitwise::hidden |
Macros | |
#define | NOMINMAX |
#define | Tpf_SignedCommonType(a, b) tpf::bitwise::signed_common_t<decltype(a), decltype(b)> |
#define | Tpf_UnignedCommonType(a, b) tpf::bitwise::unsigned_common_t<decltype(a), decltype(b)> |
Typedefs | |
template<typename T > | |
using | cpg::bitwise::enable_if_integral = std::enable_if_t< std::is_integral< T >::value > |
template<typename T , typename = enable_if_integral<T>> | |
using | cpg::bitwise::unsigned_t = std::make_unsigned_t< T > |
template<typename T , typename = enable_if_integral<T>> | |
using | cpg::bitwise::signed_t = std::make_signed_t< T > |
template<typename S , typename T > | |
using | cpg::bitwise::common_t = std::common_type_t< S, T > |
template<typename S , typename T , typename = enable_if_integral<S>, typename = enable_if_integral<T>> | |
using | cpg::bitwise::signed_common_t = signed_t< common_t< S, T > > |
template<typename S , typename T , typename = enable_if_integral<S>, typename = enable_if_integral<T>> | |
using | cpg::bitwise::unsigned_common_t = unsigned_t< common_t< S, T > > |
Functions | |
template<std::integral T> | |
int | cpg::bitwise::count_set_bits (T bits) |
template<std::integral T> | |
std::string | cpg::bitwise::to_bits (T bits) |
template<std::integral T, std::size_t N> | |
std::string | cpg::bitwise::to_bits_reverse (T(&bits)[N]) |
template<std::integral T, std::size_t N> | |
std::string | cpg::bitwise::to_bits (T(&bits)[N]) |
template<std::integral T> | |
std::string | cpg::bitwise::to_hex (T v) |
template<std::integral T, std::size_t N> | |
std::string | cpg::bitwise::to_hex_reverse (T(&v)[N]) |
template<std::integral T, std::size_t N> | |
std::string | cpg::bitwise::to_hex (T(&v)[N]) |
template<std::integral T> | |
std::string | cpg::bitwise::to_dec (T v) |
template<std::integral T, std::size_t N> | |
std::string | cpg::bitwise::to_dec_reverse (T(&v)[N]) |
template<std::integral T, std::size_t N> | |
std::string | cpg::bitwise::to_dec (T(&v)[N]) |
template<std::integral T> | |
int | cpg::bitwise::field_with (T v) |
template<std::integral T> | |
int | cpg::bitwise::numeric_width () |
template<std::integral T> | |
std::string | cpg::bitwise::to_dec_width (T v) |
template<std::integral T> | |
std::string | cpg::bitwise::numeric_base (T v) |
template<std::integral T> | |
std::string | cpg::bitwise::numeric_type_info () |
template<typename = void> | |
std::string | cpg::bitwise::integral_type_info () |
template<std::integral T> | |
std::string | cpg::bitwise::twos_complement (T c) |
Variables | |
template<typename T > | |
constexpr bool | cpg::bitwise::is_char_v = hidden::st_is_character<std::remove_cvref_t<T>>::value |
template<typename T > | |
constexpr T | cpg::bitwise::limits_max = std::numeric_limits<T>::max() |
template<typename T > | |
constexpr T | cpg::bitwise::limits_min = std::numeric_limits<T>::min() |
template<typename T > | |
constexpr int | cpg::bitwise::sizeof_bits = sizeof(T) * 8 |
template<typename T > | |
constexpr unsigned_t< T > | cpg::bitwise::high_bit_mask = unsigned_t<T>(1) << (sizeof_bits<T>-1) |
#define NOMINMAX |
Definition at line 5 of file cpg_bitwise.hpp.
#define Tpf_SignedCommonType | ( | a, | |
b | |||
) | tpf::bitwise::signed_common_t<decltype(a), decltype(b)> |
Definition at line 450 of file cpg_bitwise.hpp.
#define Tpf_UnignedCommonType | ( | a, | |
b | |||
) | tpf::bitwise::unsigned_common_t<decltype(a), decltype(b)> |
Definition at line 451 of file cpg_bitwise.hpp.