cppx-core
|
Namespaces | |
all_type_builders | |
ascii | |
basic_string_building | |
best_effort | |
bitlevel | |
boost_fix | |
byte_types | |
Byte , Signed_byte , as_number , as_std_byte | |
calc | |
Functions and constants typically available on a scientific calculator, but somehow missing from the standard library. | |
cpp17 | |
cppx | |
cstdlib | |
debug | |
fs_util | |
hf | |
hopefully_and_fail | |
impl | |
number_properties | |
Concise, clear and consistent number type properties. | |
ptr_and_ref | |
Self-descriptive but more wordy Ptr_ and Ref_ aliases for P_ and R_ . | |
rnd | |
size_types | |
std | |
string_repeat | |
type_assemblers | |
Type_ , P_ , R_ , Raw_array_ , Raw_array_of_ | |
type_makers | |
Type_choice_, Unptr_, Unref_, Signed_, Unsigned_, Const_, Unconst_ and Array_of_. | |
unicode | |
utf16 | |
utf32 | |
utf8 | |
Classes | |
class | Abstract_source_location |
class | Count_iterator_ |
class | Enumerated_ |
class | Forward_iterator_impl_ |
class | Has_method_empty_ |
struct | Head_t_ |
struct | Head_t_< Type_list_< A_type, More_types... > > |
class | In_out_ref_ |
struct | Joined_t_ |
struct | Joined_t_< Type_list_< Pack_1... >, Type_list_< Pack_2... > > |
class | Map_ |
class | Matrix_ |
class | No_copy |
class | No_copy_or_move |
struct | Number_properties_ |
The property values as members of class, so that they can be inherited in. More... | |
class | Range_ |
class | Set_ |
class | Sorted_map_ |
class | Sorted_set_ |
class | Source_location |
class | Span_ |
class | String_value_view_ |
struct | Tail_t_ |
struct | Tail_t_< Type_list_< A_type, More_types... > > |
class | Truth |
A drop-in replacement for bool without implicit conversion from/to types other than bool . More... | |
struct | Type_list_ |
Typedefs | |
using | Range = Range_< int > |
template<class Item > | |
using | Raw_array_span_ = Span_< P_< Item > > |
using | String_value_view = String_value_view_< char > |
using | WString_value_view = String_value_view_< wchar_t > |
template<class Some_type > | |
using | Type_ = Some_type |
Makes a C style type specification substitutable. More... | |
template<class Some_type > | |
using | P_ = Some_type * |
Creates a raw pointer type. More... | |
template<class Some_type > | |
using | R_ = Some_type & |
Included for completeness, creates an lvalue reference type. More... | |
template<class Item > | |
using | Raw_array_ = Item[] |
Ceates a raw array type of unknown size. More... | |
template<size_t n, class Item > | |
using | Raw_array_of_ = Item[n] |
Creates a raw array type of a specified size. More... | |
template<bool condition, class Result = void> | |
using | Enable_if_ = std::enable_if_t< condition, Result > |
Just more readable than enable_if_t . More... | |
using | Byte = unsigned char |
Default choice of byte type. More... | |
using | Signed_byte = signed char |
template<class Char > | |
using | C_str_ = P_< Const_< Char > > |
template<class Char > | |
using | Mutable_c_str_ = P_< Unconst_< Char > > |
using | C_str = C_str_< char > |
using | Wide_c_str = C_str_< wchar_t > |
using | Mutable_c_str = Mutable_c_str_< char > |
using | Mutable_wide_c_str = Mutable_c_str_< wchar_t > |
template<int n_bits> | |
using | Int_ = ... |
Signed integer types parameterized by exact width in bits. More... | |
template<int n_bits> | |
using | Unsigned_int_ = Unsigned_< Int_< n_bits > > |
Unsigned integer types parameterized by exact width in bits. More... | |
using | Size = Signed_< size_t > |
A Signed_ equivalent of size_t . More... | |
using | Index = Size |
Same as Size but with name signifying use as index. More... | |
using | Unsigned_size = size_t |
using | Unsigned_index = Unsigned_size |
template<bool condition, class A , class B > | |
using | Type_choice_ = std::conditional_t< condition, A, B > |
Reduces to type A if the condition holds, otherwise type B . More... | |
template<class Some_pointer_type > | |
using | Unptr_ = std::remove_pointer_t< Some_pointer_type > |
Reduces a type T* to just T . More... | |
template<class Some_reference_type > | |
using | Unref_ = std::remove_reference_t< Some_reference_type > |
Reduces a type T& or T&& to just T . More... | |
template<class Integer > | |
using | Signed_ = std::make_signed_t< Integer > |
For an integer type, produces the corresponding signed type. More... | |
template<class Integer > | |
using | Unsigned_ = std::make_unsigned_t< Integer > |
For an integer type, produces the corresponding unsigned type. More... | |
template<class Some_type > | |
using | Const_ = std::add_const_t< Some_type > |
For a type T produces const T . More... | |
template<class Some_type > | |
using | Unconst_ = std::remove_const_t< Some_type > |
For a type const T produces plain T . More... | |
template<size_t n, class Item > | |
using | Array_of_ = std::array< Item, n > |
Array_of_<n, T> is just more left-to-right direction readable than std::array<T, n> , which is the type it produces. More... | |
template<class A_type_list > | |
using | Head_ = typename Head_t_< A_type_list >::T |
template<class A_type_list > | |
using | Tail_ = typename Tail_t_< A_type_list >::T |
template<class Type_list_1 , class Type_list_2 > | |
using | Joined_ = typename Joined_t_< Type_list_1, Type_list_2 >::T |
using | Char_variant_types = Type_list_< unsigned char, signed char > |
using | Byte_char_types = Type_list_< char, unsigned char, signed char > |
using | Cpp03_char_literal_types = Type_list_< char, wchar_t > |
using | Char_literal_types_introduced_in_11 = Type_list_< char16_t, char32_t > |
using | Cpp11_char_literal_types = Joined_< Cpp03_char_literal_types, Char_literal_types_introduced_in_11 > |
template<class Iterator > | |
using | Item_for_iterator_ = typename std::iterator_traits< Iterator >::value_type |
template<class Collection > | |
using | Item_for_collection_ = Unref_< decltype(*begin(declval< Collection & >()))> |
template<class Collection > | |
using | Iterator_for_ = decltype(begin(declval< Collection & >())) |
using | Timer_clock = conditional_t< chrono::high_resolution_clock::is_steady, chrono::high_resolution_clock, chrono::steady_clock > |
Functions | |
CPPX_USE_STD (basic_string, basic_string_view, bitset, char_traits, size) | |
template<class Collection > | |
constexpr auto | n_items_of (const Collection &c) noexcept -> Size |
template<size_t n> | |
auto | n_items_of (const bitset< n > &bits) noexcept -> Size |
template<class Char > | |
auto | length_of (const P_< const Char > s) noexcept -> Size |
template<class Char > | |
auto | length_of (const basic_string< Char > &s) noexcept -> Size |
template<class Char > | |
auto | length_of (const basic_string_view< Char > &sv) noexcept -> Size |
CPPX_USE_STD (declval, initializer_list) | |
template<class Collection > | |
auto | enumerated (Collection &c) -> Enumerated_< Collection > |
template<class Item > | |
auto | enumerated (const initializer_list< Item > &list) -> Enumerated_< const initializer_list< Item >> |
CPPX_USE_STD (begin, end, declval, true_type, false_type) | |
template<class Collection > | |
auto | is_empty (const Collection &c) -> Truth |
auto | is_empty (const P_< const char > s) -> Truth |
auto | is_empty (const P_< const wchar_t > s) -> Truth |
auto | is_empty (const P_< const char16_t > s) -> Truth |
auto | is_empty (const P_< const char32_t > s) -> Truth |
CPPX_USE_STD (basic_string_view, begin, binary_search, bitset, end, find, initializer_list) | |
template<class Char > | |
auto | is_in (const basic_string_view< Char > &sv, const Char ch) noexcept -> Truth |
template<class Item , class Value > | |
auto | is_in (const initializer_list< Item > &items, const Value &v) noexcept -> Truth |
template<size_t n> | |
auto | is_in (const bitset< n > &bits, const int i) noexcept -> Truth |
template<class It , class Arg > | |
auto | is_in_span (const It begin, const It end, const Arg &v) -> Truth |
template<class Key , Size n, class Arg > | |
auto | is_in (Raw_array_of_< n, const Key > &a, const Arg &v) -> Truth |
template<class It , class Arg > | |
auto | is_in_sorted_span (const It begin, const It end, const Arg &v) -> Truth |
template<class Key , Size n, class Arg > | |
auto | is_in_sorted (Raw_array_of_< n, const Key > &a, const Arg &v) -> Truth |
CPPX_USE_STD (unordered_map) | |
template<class Key , class Value , class Arg > | |
auto | is_in (const unordered_map< Key, Value > &map, const Arg &v) -> Truth |
CPPX_USE_STD (out_of_range, vector) | |
template<class Integer > | |
void | reversed (const Range_< Integer > &)=delete |
template<class Integer = int> | |
constexpr auto | up_to (const Integer n) noexcept -> Range_< Integer > |
template<class Integer > | |
auto | is_in (const Range_< Integer > &range, const Integer v) -> Truth |
CPPX_USE_STD (initializer_list, move, unordered_set) | |
template<class Key , class Arg > | |
auto | is_in (const unordered_set< Key > &set, const Arg &v) -> Truth |
template<class Key > | |
auto | as_set (const Key &a_key) -> Set_< Key > |
template<class Integer > | |
auto | as_set (const Range_< Integer > range) -> Set_< Integer > |
template<class Key > | |
auto | as_set (const initializer_list< Key > &values) -> Set_< Key > |
template<class Key > | |
auto | set_union (const unordered_set< Key > &a, const unordered_set< Key > &b) -> Set_< Key > |
template<class Key , class Arg > | |
auto | set_union (const unordered_set< Key > &a, const Arg &b) -> Set_< Key > |
template<class Key , class Arg > | |
auto | set_union (const Arg &a, const unordered_set< Key > &b) -> Set_< Key > |
template<class Key > | |
auto | set_difference (const unordered_set< Key > &a, const unordered_set< Key > &b) -> Set_< Key > |
template<class Key , class Arg > | |
auto | set_difference (const unordered_set< Key > &a, const Arg &b) -> Set_< Key > |
template<class Key > | |
auto | set_intersection (const unordered_set< Key > &a, const unordered_set< Key > &b) -> Set_< Key > |
template<class Key > | |
auto | set_difference (Set_< Key > &&a, const unordered_set< Key > &b) -> Set_< Key > && |
CPPX_USE_STD (map) | |
template<class Key , class Value , class Arg > | |
auto | is_in (const Sorted_map_< Key, Value > &map, const Arg &v) -> Truth |
CPPX_USE_STD (initializer_list, move, set) | |
template<class Key , class Arg > | |
auto | is_in (const set< Key > &set, const Arg &v) -> Truth |
template<class Key > | |
auto | as_sorted_set (const Key &a_key) -> Sorted_set_< Key > |
template<class Integer > | |
auto | as_sorted_set (const Range_< Integer > range) -> Sorted_set_< Integer > |
template<class Key > | |
auto | as_sorted_set (const initializer_list< Key > &values) -> Sorted_set_< Key > |
template<class Key > | |
auto | set_union (const set< Key > &a, const set< Key > &b) -> Sorted_set_< Key > |
template<class Key , class Arg > | |
auto | set_union (const set< Key > &a, const Arg &b) -> Sorted_set_< Key > |
template<class Key , class Arg > | |
auto | set_union (const Arg &a, const set< Key > &b) -> Sorted_set_< Key > |
template<class Key > | |
auto | set_difference (const set< Key > &a, const set< Key > &b) -> Sorted_set_< Key > |
template<class Key , class Arg > | |
auto | set_difference (const set< Key > &a, const Arg &b) -> Sorted_set_< Key > |
template<class Key > | |
auto | set_intersection (const set< Key > &a, const set< Key > &b) -> Sorted_set_< Key > |
template<class Key > | |
auto | set_difference (Sorted_set_< Key > &&a, const set< Key > &b) -> Sorted_set_< Key > && |
CPPX_USE_STD (begin, declval, distance, end, make_reverse_iterator, move, next, prev, queue, reverse_iterator, stack) | |
template<class Collection > | |
auto | it_begin_of (Collection &&c) |
template<class Collection > | |
auto | it_end_of (Collection &&c) |
template<class Iterator > | |
auto | n_items_of (const Span_< Iterator > &range) -> Size |
template<class Iterator > | |
auto | span_of (const Iterator first, const Iterator beyond) -> Span_< Iterator > |
template<class Container > | |
auto | all_of (Container &&c) -> Span_< decltype(begin(c))> |
template<class Item , class Container > | |
auto | all_of (const queue< Item, Container > &q) -> Span_< decltype(begin(declval< const Container >()))> |
template<class Item , class Container > | |
auto | all_of (const stack< Item, Container > &st) -> Span_< decltype(begin(declval< const Container >()))> |
template<class Container > | |
auto | all_but_first_of (Container &&c) -> Span_< decltype(begin(c))> |
template<class Container > | |
auto | all_but_first_n_of (Container &&c, const Size n) -> Span_< decltype(begin(c))> |
template<class Container > | |
auto | all_but_last_of (Container &&c) -> Span_< decltype(begin(c))> |
template<class Char , Size n> | |
auto | text_span_of_literal (const Raw_array_of_< n, const Char > &string_literal) -> Span_< P_< const Char >> |
template<class Container > | |
auto | all_but_last_n_of (Container &&c, const Size n) -> Span_< decltype(begin(c))> |
template<class Container > | |
auto | reversed (Container &&c) -> Span_< reverse_iterator< decltype(begin(c))>> |
CPPX_USE_STD (basic_string, basic_string_view) | |
template<class Char > | |
auto | is_empty (const String_value_view_< Char > &svv) -> Truth |
CPPX_USE_STD (string, string_view, to_string) | |
auto | to_string (const Abstract_source_location &loc) -> string |
CPPX_USE_STD (exception_ptr, rethrow_exception) | |
auto | replace_stored_x_with (const exception_ptr &p) -> exception_ptr |
void | clear_stored_x () |
void | rethrow_any_stored_x () |
CPPX_USE_STD (exception, function, move, rethrow_if_nested, string) | |
void | call_with_description_lines_from (const exception &x, const function< void(const C_str)> &f) |
auto | description_lines_from (const exception &x) -> string |
void | dbginfo (const String_value_view &) |
CPPX_USE_STD (string, move, optional) | |
CPPX_USE_STD (string, string_view) | |
auto | monospaced_bullet_block (const string_view &s, const string_view &bullet=best_effort::bullet_str, const int indent_size=4) -> string |
CPPX_USE_STD (forward_iterator_tag) | |
CPPX_USE_STD (numeric_limits) | |
template<class Unsigned > | |
constexpr auto | intlog2 (const Unsigned x) noexcept -> int |
The position of the most significant bit in an unsigned value, or -1 for value zero. More... | |
template<int n> | |
auto | sum_of_bits (const bitset< n > &bits) noexcept -> int |
The number of 1-bits in a std::bitset . More... | |
template<class Unsigned > | |
auto | sum_of_bits (const uint16_t x) noexcept -> int |
The number of 1-bits in an unsigned value. More... | |
template<class Number = double> | |
auto | intpow (const Number base, const int exponent) -> Number |
Efficient x to the n'th power, when n is an integer. More... | |
auto | squared (const double x) -> double |
The square (second power) of the argument. More... | |
auto | cubed (const double x) -> double |
The cube (third power) of the argument. More... | |
template<class Int > | |
auto | is_even (const Int x) -> Truth |
template<class Int > | |
auto | is_odd (const Int x) -> Truth |
template<class Int > | |
auto | intdiv (const Int a, const Int b) noexcept -> Int |
auto | intmod (const int a, const int b) noexcept -> int |
template<class Int = int> | |
auto | intsquare (const Int x) -> Int |
template<class Int = int> | |
auto | intcube (const Int x) -> Int |
template<class... Ints> | |
auto | intmin (const Ints... args) -> std::common_type_t< Ints... > |
template<class... Ints> | |
auto | intmax (const Ints... args) -> std::common_type_t< Ints... > |
template<class Number > | |
constexpr auto | nan_ () -> Number |
constexpr auto | nan () -> double |
template<class Number > | |
constexpr auto | infinity_ () -> Number |
constexpr auto | infinity () -> double |
auto | as_number (const std::byte value) -> Byte |
auto | as_std_byte (const Byte value) -> std::byte |
CPPX_USE_STD (array, bitset) | |
template<class Item , size_t n> | |
constexpr auto | array_size_of (const Raw_array_of_< n, Item > &) noexcept -> Size |
template<class Item , size_t n> | |
constexpr auto | array_size_of (const array< Item, n > &) noexcept -> Size |
template<class Item , size_t n> | |
constexpr auto | array_size_of (const bitset< n > &) noexcept -> Size |
template<class Char , Size n> | |
constexpr auto | length_of_literal (Raw_array_of_< n, const Char > &s) noexcept -> Size |
CPPX_USE_STD (enable_if_t, is_same_v) | |
template<class Type > | |
auto | only_lvalue_ref_to (Type &c) -> Type & |
A helper for restricting macro arguments, used e.g. in $items_of . More... | |
template<class Derived , class Type , class = Enable_if_<is_base_and_derived_<Type, Derived>>> | |
auto | downcasted_to_ (P_< Type > p) -> P_< Derived > |
template<class Derived , class Type , class = Enable_if_<is_base_and_derived_<Type, Derived>>> | |
auto | is_of_derived_class_ (const Type &o) -> Truth |
CPPX_USE_STD (begin, declval) | |
CPPX_USE_STD_NAMESPACE_NAMES (chrono) | |
CPPX_USE_STD (conditional_t, milli, micro, nano) | |
template<class Rep , class Period > | |
auto | as_seconds (const chrono::duration< Rep, Period > duration_value) -> double |
template<class Rep , class Period > | |
auto | as_milliseconds (const chrono::duration< Rep, Period > duration_value) -> double |
template<class Rep , class Period > | |
auto | as_microseconds (const chrono::duration< Rep, Period > duration_value) -> double |
template<class Rep , class Period > | |
auto | as_nanoseconds (const chrono::duration< Rep, Period > duration_value) -> double |
CPPX_USE_STD (copy, exchange, string) | |
CPPX_USE_STD (forward) | |
template<class Func , class... Args> | |
void | repeat (const Size n, const Func &f, Args &&... args) |
CPPX_USE_STD (ref, reference_wrapper) | |
template<class Type , class = Enable_if_<not is_const_<Type>>> | |
auto | in_out_ref (Type &o) -> In_out_ref_< Type > |
CPPX_USE_STD (ostringstream, string, string_view) | |
CPPX_USE_STD (basic_string_view) | |
template<class Char > | |
auto | p_first_of (const basic_string_view< Char > &view) noexcept -> C_str_< Char > |
template<class Char > | |
auto | p_beyond_of (const basic_string_view< Char > &view) noexcept -> C_str_< Char > |
CPPX_USE_STD (basic_string_view, move, next, string, string_view) | |
auto | spaces (const int n) -> string |
auto | left (const string_view &s, const int width) -> string |
auto | right (const string_view &s, const int width) -> string |
auto | quoted (const string_view &sv) -> string |
auto | quoted (const char ch) -> string |
auto | trimmed (const string_view &sv) -> string_view |
auto | trimmed (const string &s) -> string |
auto | trimmed (string &&s) -> string |
auto | split () -> void |
template<class Iterator > | |
auto | joined (const Span_< Iterator > range, const string &separator=" ") -> string |
Variables | |
template<class Collection > | |
constexpr Truth | has_method_empty_ = Has_method_empty_<Collection>::value |
constexpr Truth | check_the_execution_character_set = true |
constexpr Truth | use_ascii_substitutes = false |
const int | bits_per_byte = CHAR_BIT |
Usually 8, but e.g. 16 on some DSPs. More... | |
template<class Type > | |
constexpr int | bits_per_ = sizeof( Type )*bits_per_byte |
The number of bits per object/value of the specified type. More... | |
template<class Type > | |
constexpr int | magnitude_bits_per_ = numeric_limits<Type>::digits |
The number of bits that determine the magnitude, i.e. the number of value representation bits minus a sign bit, if any. More... | |
const auto | e = 2.71828182845904523536 |
const auto | log2e = 1.44269504088896340736 |
const auto | log10e = 0.434294481903251827651 |
const auto | ln2 = 0.693147180559945309417 |
const auto | ln10 = 2.30258509299404568402 |
const auto | pi = 3.14159265358979323846 |
const auto | inv_sqrt_pi = 1.12837916709551257390 |
const auto | sqrt2 = 1.41421356237309504880 |
const auto | inv_sqrt2 = 0.707106781186547524401 |
template<class Number = double> | |
constexpr Truth | has_nan_ = numeric_limits<Number>::has_quiet_NaN |
constexpr Truth | has_nan = has_nan_<double> |
template<class Number = double> | |
constexpr Truth | has_infinity_ = numeric_limits<double>::has_infinity |
constexpr Truth | has_infinity = has_infinity_<double> |
template<class T > | |
constexpr Truth | is_ieee_754_ |
FP only. Whether the implementation claims to conform to the IEEE 754 standard. More... | |
template<class T > | |
constexpr T | largest_ |
The largest representable-as-positive absolute value of the type. More... | |
template<class T > | |
constexpr T | smallest_ |
The smallest non-zero absolute value of the type. More... | |
template<class T > | |
constexpr T | max_ |
The largest positive value of the type. More... | |
template<class T > | |
constexpr T | min_ |
The largest negative value of the type. More... | |
template<class T > | |
constexpr int | max_e_ |
FP only. E-notation maximum (largest positive) exponent value. More... | |
template<class T > | |
constexpr int | min_e_ |
FP only. E-notation minimum (largest negative) exponent value. More... | |
template<class T > | |
constexpr int | n_digits_ |
Number of decimal digits that guaranteed can be represented. More... | |
template<class T > | |
constexpr int | radix_ |
FP only. The numeral system base of the floating point representation, 2 or 10. More... | |
template<class T > | |
constexpr T | epsilon_ |
The difference between 1 and the least floating point value greater than 1. More... | |
template<class Base , class Derived > | |
constexpr Truth | is_base_and_derived_ = std::is_base_of_v<Base, Derived> |
template<class T , class U > | |
constexpr Truth | is_same_type_ = std::is_same_v<T, U> |
template<class T , class U > | |
constexpr Truth | is_a_ = is_same_type_<T, U> or is_base_and_derived_<T, U> |
template<class T > | |
constexpr Truth | is_const_ = std::is_const_v<std::remove_reference_t<T>> |
template<class T > | |
constexpr Truth | is_class_ = std::is_class_v<T> |
template<class T > | |
constexpr Truth | is_fixed_point_ = false |
template<class T > | |
constexpr Truth | is_floating_point_ = std::is_floating_point_v<T> |
template<class T > | |
constexpr Truth | is_integral_ = std::is_integral_v<T> |
template<class Int > | |
constexpr Truth | is_signed_ = std::is_signed_v<Int> |
template<class Int > | |
constexpr Truth | is_unsigned_ = std::is_unsigned_v<Int> |
template<class Some_type , class Type_list > | |
constexpr bool | contains_type_ |
template<class Possible_subset , class Main_set > | |
constexpr bool | contains_type_subset_ |
template<class Char > | |
constexpr Truth | is_a_cpp03_char_type_ = contains_type_<Char, Cpp03_char_literal_types> |
template<class Char > | |
constexpr Truth | is_a_cpp11_char_type_ = contains_type_<Char, Cpp11_char_literal_types> |
template<class Char > | |
constexpr Truth | is_a_char_type_ = is_a_cpp11_char_type_<Char> |
template<class Char > | |
constexpr Truth | is_a_char_variant_type_ = contains_type_<Char, Char_variant_types> |
template<class Char > | |
constexpr Truth | is_a_byte_char_type_ = contains_type_<Char, Byte_char_types> |
const char | std_ascii_bad_char = ascii::end_of_text |
const wchar_t | std_unicode_bad_char = L'\uFFFD' |
template<class Char > | |
constexpr Raw_array_of_< 1, const Char > | empty_c_string = {} |
Common math/calculator constants: e, log2e, log10e, ln2, ln10, pi, inv_sqrt_pi, sqrt2, inv_sqrt2, has_nan_ and has_nan, nan_ and nan, has_infinity_ and has_infinity, infinity_ and infinity.
The template aliases defined in this file generally do not support template argument deduction. In contrast, the basic type assemblers like P_ and R_, do. Those basic type assemblers are also offered by this header, via a convenience include of <cppx-core/language/syntax/type-assemblers.hpp>
.
using cppx::Array_of_ = typedef std::array<Item, n> |
Array_of_<n, T>
is just more left-to-right direction readable than std::array<T, n>
, which is the type it produces.
Definition at line 65 of file type-makers.hpp.
using cppx::Byte = typedef unsigned char |
Default choice of byte type.
Definition at line 19 of file byte-types.hpp.
using cppx::Byte_char_types = typedef Type_list_<char, unsigned char, signed char> |
Definition at line 18 of file type-traits.hpp.
using cppx::C_str = typedef C_str_<char> |
Definition at line 38 of file C_str_.hpp.
using cppx::C_str_ = typedef P_<Const_<Char> > |
Definition at line 33 of file C_str_.hpp.
using cppx::Char_literal_types_introduced_in_11 = typedef Type_list_<char16_t, char32_t> |
Definition at line 22 of file type-traits.hpp.
using cppx::Char_variant_types = typedef Type_list_<unsigned char, signed char> |
Definition at line 17 of file type-traits.hpp.
using cppx::Const_ = typedef std::add_const_t< Some_type > |
For a type T
produces const T
.
Definition at line 53 of file type-makers.hpp.
using cppx::Cpp03_char_literal_types = typedef Type_list_<char, wchar_t> |
Definition at line 20 of file type-traits.hpp.
using cppx::Cpp11_char_literal_types = typedef Joined_< Cpp03_char_literal_types, Char_literal_types_introduced_in_11 > |
Definition at line 27 of file type-traits.hpp.
using cppx::Enable_if_ = typedef std::enable_if_t<condition, Result> |
Just more readable than enable_if_t
.
Definition at line 12 of file basic-Enable_if_.hpp.
using cppx::Head_ = typedef typename Head_t_<A_type_list>::T |
Definition at line 22 of file Type_list_.hpp.
using cppx::Index = typedef Size |
Same as Size but with name signifying use as index.
Definition at line 32 of file signed-size-types.hpp.
using cppx::Int_ = typedef ... |
using cppx::Item_for_collection_ = typedef Unref_<decltype( *begin( declval<Collection&>() ) )> |
Definition at line 53 of file type-traits.hpp.
using cppx::Item_for_iterator_ = typedef typename std::iterator_traits<Iterator>::value_type |
Definition at line 50 of file type-traits.hpp.
using cppx::Iterator_for_ = typedef decltype( begin( declval<Collection&>() ) ) |
Definition at line 56 of file type-traits.hpp.
using cppx::Joined_ = typedef typename Joined_t_<Type_list_1, Type_list_2>::T |
Definition at line 48 of file Type_list_.hpp.
using cppx::Mutable_c_str = typedef Mutable_c_str_<char> |
Definition at line 40 of file C_str_.hpp.
using cppx::Mutable_c_str_ = typedef P_<Unconst_<Char> > |
Definition at line 36 of file C_str_.hpp.
using cppx::Mutable_wide_c_str = typedef Mutable_c_str_<wchar_t> |
Definition at line 41 of file C_str_.hpp.
using cppx::P_ = typedef Some_type* |
Creates a raw pointer type.
P_<T>
is the type denoted by Type_<T>*
, wrapped up. It's equivalent to writing Type_<Type_<T>*>
. Except for missing template argument deduction ability and added verbosity it can also be expressed as std::add_pointer_t<T>
.
Definition at line 54 of file type-assemblers.hpp.
using cppx::R_ = typedef Some_type& |
Included for completeness, creates an lvalue reference type.
R_<T>
is the type denoted by Type_<T>&
, wrapped up. It's equivalent to writing Type_<Type_<T>&>
. Except for missing template argument deduction and added verbosity it can also be expressed as std::add_lvalue_reference_t<T>
.
Preferably write just T&
or Type_<T>&
, and not the less eye-friendly R_<T>
.
Definition at line 64 of file type-assemblers.hpp.
using cppx::Range = typedef Range_<int> |
Definition at line 55 of file Range_.hpp.
using cppx::Raw_array_ = typedef Item[] |
Ceates a raw array type of unknown size.
Raw_array_<T>
is the type denoted by Type_<T>[]
, wrapped up. It's equivalent to writing Type_<Type_<T>[]>
. The C++17 standard library provides no notation for this.
A raw array of unknown size can acquire a size via an initializer, e.g. const Raw_array_of<int> numbers = {1, 2, 3};
(where the size is then 3).
Definition at line 75 of file type-assemblers.hpp.
using cppx::Raw_array_of_ = typedef Item[n] |
Creates a raw array type of a specified size.
Raw_array_of_<n, T>
is the type denoted by Type_<T>[n]
, wrapped up. It's equivalent to writing Type_<Type_<T>[n]>
. The C++17 standard library provides no notation for this.
Definition at line 83 of file type-assemblers.hpp.
using cppx::Raw_array_span_ = typedef Span_<P_<Item> > |
using cppx::Signed_ = typedef std::make_signed_t< Integer > |
For an integer type, produces the corresponding signed type.
Definition at line 45 of file type-makers.hpp.
using cppx::Signed_byte = typedef signed char |
Definition at line 20 of file byte-types.hpp.
using cppx::Size = typedef Signed_< size_t > |
A Signed_ equivalent of size_t
.
Definition at line 29 of file signed-size-types.hpp.
using cppx::String_value_view = typedef String_value_view_<char> |
Definition at line 56 of file String_value_view_.hpp.
using cppx::Tail_ = typedef typename Tail_t_<A_type_list>::T |
Definition at line 33 of file Type_list_.hpp.
using cppx::Timer_clock = typedef conditional_t<chrono::high_resolution_clock::is_steady, chrono::high_resolution_clock, chrono::steady_clock > |
Definition at line 20 of file chrono-util.hpp.
using cppx::Type_ = typedef Some_type |
Makes a C style type specification substitutable.
Type_<T>
is the type denoted by the type expression T
, wrapped up so that other type builders (e.g. const
) can be applied to it.
E.g. instead of the difficult-to-parse
int (& (*const fp)())[42];
you can write it with prefix const
as
const Type_<Type_<auto()->int(&)[42]>*> fp;
although for this particular example using the P_
type builder is more clean:
const P_<auto()->int(&)[42]> fp;
Credit: I first saw a template like Type_
suggested by Johannes “litb” Schaub.
Definition at line 46 of file type-assemblers.hpp.
using cppx::Type_choice_ = typedef std::conditional_t<condition, A, B> |
Reduces to type A
if the condition holds, otherwise type B
.
condition | A compile time boolean expression. |
A | Result type when the condition holds. |
B | Result type when the condition doesn't hold. |
Definition at line 33 of file type-makers.hpp.
using cppx::Unconst_ = typedef std::remove_const_t< Some_type > |
For a type const T
produces plain T
.
Definition at line 57 of file type-makers.hpp.
using cppx::Unptr_ = typedef std::remove_pointer_t<Some_pointer_type> |
Reduces a type T*
to just T
.
Definition at line 37 of file type-makers.hpp.
using cppx::Unref_ = typedef std::remove_reference_t<Some_reference_type> |
Reduces a type T&
or T&&
to just T
.
Definition at line 41 of file type-makers.hpp.
using cppx::Unsigned_ = typedef std::make_unsigned_t< Integer > |
For an integer type, produces the corresponding unsigned type.
Definition at line 49 of file type-makers.hpp.
using cppx::Unsigned_index = typedef Unsigned_size |
Definition at line 35 of file signed-size-types.hpp.
using cppx::Unsigned_int_ = typedef Unsigned_<Int_<n_bits> > |
using cppx::Unsigned_size = typedef size_t |
Definition at line 34 of file signed-size-types.hpp.
using cppx::Wide_c_str = typedef C_str_<wchar_t> |
Definition at line 39 of file C_str_.hpp.
using cppx::WString_value_view = typedef String_value_view_<wchar_t> |
Definition at line 57 of file String_value_view_.hpp.
|
inline |
|
inline |
|
inline |
auto cppx::all_of | ( | const queue< Item, Container > & | q | ) | -> Span_<decltype( begin( declval<const Container>() ) )> |
auto cppx::all_of | ( | const stack< Item, Container > & | st | ) | -> Span_<decltype( begin( declval<const Container>() ) )> |
|
noexcept |
Definition at line 24 of file fixed-size-checking.hpp.
|
noexcept |
Definition at line 29 of file fixed-size-checking.hpp.
|
noexcept |
Definition at line 34 of file fixed-size-checking.hpp.
|
inline |
Definition at line 33 of file chrono-util.hpp.
|
inline |
Definition at line 28 of file chrono-util.hpp.
|
inline |
Definition at line 38 of file chrono-util.hpp.
|
inline |
Definition at line 22 of file byte-types.hpp.
|
inline |
Definition at line 23 of file chrono-util.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 65 of file Sorted_set_.hpp.
|
inline |
Definition at line 70 of file Sorted_set_.hpp.
|
inline |
Definition at line 75 of file Sorted_set_.hpp.
|
inline |
Definition at line 26 of file byte-types.hpp.
|
inline |
Definition at line 15 of file exception-unwrapping.hpp.
|
inline |
Definition at line 32 of file exception-propagation.hpp.
cppx::CPPX_USE_STD | ( | string | , |
string_view | |||
) |
cppx::CPPX_USE_STD | ( | forward | ) |
cppx::CPPX_USE_STD | ( | unordered_map | ) |
cppx::CPPX_USE_STD | ( | basic_string_view | ) |
cppx::CPPX_USE_STD | ( | exception_ptr | , |
rethrow_exception | |||
) |
cppx::CPPX_USE_STD | ( | map | ) |
cppx::CPPX_USE_STD | ( | ref | , |
reference_wrapper | |||
) |
cppx::CPPX_USE_STD | ( | ostringstream | , |
string | , | ||
string_view | |||
) |
cppx::CPPX_USE_STD | ( | conditional_t | , |
milli | , | ||
micro | , | ||
nano | |||
) |
cppx::CPPX_USE_STD | ( | exception | , |
function | , | ||
move | , | ||
rethrow_if_nested | , | ||
string | |||
) |
cppx::CPPX_USE_STD | ( | begin | , |
end | , | ||
declval | , | ||
true_type | , | ||
false_type | |||
) |
cppx::CPPX_USE_STD | ( | basic_string | , |
basic_string_view | , | ||
bitset | , | ||
char_traits | , | ||
size | |||
) |
cppx::CPPX_USE_STD | ( | basic_string | , |
basic_string_view | |||
) |
cppx::CPPX_USE_STD | ( | out_of_range | , |
vector | |||
) |
cppx::CPPX_USE_STD | ( | basic_string_view | , |
move | , | ||
next | , | ||
string | , | ||
string_view | |||
) |
cppx::CPPX_USE_STD | ( | string | , |
string_view | , | ||
to_string | |||
) |
cppx::CPPX_USE_STD | ( | numeric_limits | ) |
cppx::CPPX_USE_STD | ( | initializer_list | , |
move | , | ||
set | |||
) |
cppx::CPPX_USE_STD | ( | enable_if_t | , |
is_same_v | |||
) |
cppx::CPPX_USE_STD | ( | begin | , |
declval | |||
) |
cppx::CPPX_USE_STD | ( | initializer_list | , |
move | , | ||
unordered_set | |||
) |
cppx::CPPX_USE_STD | ( | basic_string_view | , |
begin | , | ||
binary_search | , | ||
bitset | , | ||
end | , | ||
find | , | ||
initializer_list | |||
) |
cppx::CPPX_USE_STD | ( | declval | , |
initializer_list | |||
) |
cppx::CPPX_USE_STD | ( | begin | , |
declval | , | ||
distance | , | ||
end | , | ||
make_reverse_iterator | , | ||
move | , | ||
next | , | ||
prev | , | ||
queue | , | ||
reverse_iterator | , | ||
stack | |||
) |
cppx::CPPX_USE_STD | ( | array | , |
bitset | |||
) |
cppx::CPPX_USE_STD | ( | string | , |
move | , | ||
optional | |||
) |
cppx::CPPX_USE_STD | ( | copy | , |
exchange | , | ||
string | |||
) |
cppx::CPPX_USE_STD | ( | forward_iterator_tag | ) |
cppx::CPPX_USE_STD_NAMESPACE_NAMES | ( | chrono | ) |
|
inline |
The cube (third power) of the argument.
Definition at line 62 of file floating-point-operations.hpp.
void cppx::dbginfo | ( | const String_value_view & | ) |
|
inline |
Definition at line 35 of file exception-unwrapping.hpp.
|
inline |
Definition at line 26 of file downcasted_to_.hpp.
auto cppx::enumerated | ( | Collection & | c | ) | -> Enumerated_<Collection> |
Definition at line 77 of file Enumerated_.hpp.
auto cppx::enumerated | ( | const initializer_list< Item > & | list | ) | -> Enumerated_<const initializer_list<Item>> |
Definition at line 82 of file Enumerated_.hpp.
|
inline |
Definition at line 35 of file In_out_ref_.hpp.
|
inline |
Definition at line 80 of file named-numbers.hpp.
constexpr auto cppx::infinity_ | ( | ) | -> Number |
Definition at line 76 of file named-numbers.hpp.
|
inline |
Definition at line 53 of file integer-operations.hpp.
|
inlinenoexcept |
Definition at line 36 of file integer-operations.hpp.
|
inlinenoexcept |
The position of the most significant bit in an unsigned value, or -1 for value zero.
Definition at line 52 of file intlog2.hpp.
|
inline |
Definition at line 66 of file integer-operations.hpp.
|
inline |
Definition at line 58 of file integer-operations.hpp.
|
inlinenoexcept |
Definition at line 43 of file integer-operations.hpp.
|
inline |
Efficient x to the n'th power, when n is an integer.
base | The x in “*x* to the n'th”. |
exponent | The n in “*x* to the n'th”. |
Essentially this is Horner's rule adapted to calculating a power, so that the number of floating point multiplications is at worst O(log2(n)).
Definition at line 46 of file floating-point-operations.hpp.
|
inline |
Definition at line 48 of file integer-operations.hpp.
|
inline |
Definition at line 33 of file is_empty.hpp.
Definition at line 46 of file is_empty.hpp.
Definition at line 47 of file is_empty.hpp.
Definition at line 48 of file is_empty.hpp.
Definition at line 49 of file is_empty.hpp.
|
inline |
Definition at line 52 of file String_value_view_.hpp.
|
inline |
Definition at line 26 of file integer-operations.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
auto cppx::is_in | ( | const Sorted_map_< Key, Value > & | map, |
const Arg & | v | ||
) | -> Truth |
Definition at line 27 of file Sorted_map_.hpp.
auto cppx::is_in | ( | const unordered_map< Key, Value > & | map, |
const Arg & | v | ||
) | -> Truth |
|
inlinenoexcept |
auto cppx::is_in | ( | Raw_array_of_< n, const Key > & | a, |
const Arg & | v | ||
) | -> Truth |
auto cppx::is_in | ( | const set< Key > & | set, |
const Arg & | v | ||
) | -> Truth |
Definition at line 57 of file Sorted_set_.hpp.
auto cppx::is_in | ( | const unordered_set< Key > & | set, |
const Arg & | v | ||
) | -> Truth |
auto cppx::is_in | ( | const Range_< Integer > & | range, |
const Integer | v | ||
) | -> Truth |
Definition at line 66 of file Range_.hpp.
auto cppx::is_in_sorted | ( | Raw_array_of_< n, const Key > & | a, |
const Arg & | v | ||
) | -> Truth |
auto cppx::is_in_sorted_span | ( | const It | begin, |
const It | end, | ||
const Arg & | v | ||
) | -> Truth |
auto cppx::is_in_span | ( | const It | begin, |
const It | end, | ||
const Arg & | v | ||
) | -> Truth |
|
inline |
Definition at line 31 of file integer-operations.hpp.
|
inline |
Definition at line 18 of file is_of_derived_class_.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 115 of file string-util.hpp.
|
inline |
Definition at line 48 of file string-util.hpp.
Definition at line 27 of file dynamic-size-checking.hpp.
|
inlinenoexcept |
Definition at line 32 of file dynamic-size-checking.hpp.
|
inlinenoexcept |
Definition at line 37 of file dynamic-size-checking.hpp.
|
inlinenoexcept |
Definition at line 39 of file fixed-size-checking.hpp.
|
inline |
Definition at line 9 of file monospaced_bullet_block.hpp.
|
noexcept |
Definition at line 17 of file dynamic-size-checking.hpp.
|
noexcept |
Definition at line 22 of file dynamic-size-checking.hpp.
|
inline |
Definition at line 66 of file named-numbers.hpp.
constexpr auto cppx::nan_ | ( | ) | -> Number |
Definition at line 62 of file named-numbers.hpp.
|
inline |
A helper for restricting macro arguments, used e.g. in $items_of
.
Definition at line 9 of file only_lvalue_ref_to.hpp.
|
inlinenoexcept |
Definition at line 21 of file pointers-from-string_view.hpp.
|
inlinenoexcept |
Definition at line 16 of file pointers-from-string_view.hpp.
|
inline |
Definition at line 60 of file string-util.hpp.
|
inline |
Definition at line 70 of file string-util.hpp.
void cppx::repeat | ( | const Size | n, |
const Func & | f, | ||
Args &&... | args | ||
) |
Definition at line 11 of file repeat.hpp.
|
inline |
Definition at line 24 of file exception-propagation.hpp.
|
inline |
Definition at line 37 of file exception-propagation.hpp.
|
delete |
|
inline |
|
inline |
Definition at line 52 of file string-util.hpp.
auto cppx::set_difference | ( | const unordered_set< Key > & | a, |
const unordered_set< Key > & | b | ||
) | -> Set_<Key> |
auto cppx::set_difference | ( | const set< Key > & | a, |
const set< Key > & | b | ||
) | -> Sorted_set_<Key> |
Definition at line 108 of file Sorted_set_.hpp.
auto cppx::set_difference | ( | const unordered_set< Key > & | a, |
const Arg & | b | ||
) | -> Set_<Key> |
auto cppx::set_difference | ( | const set< Key > & | a, |
const Arg & | b | ||
) | -> Sorted_set_<Key> |
Definition at line 120 of file Sorted_set_.hpp.
auto cppx::set_difference | ( | Sorted_set_< Key > && | a, |
const set< Key > & | b | ||
) | -> Sorted_set_<Key>&& |
Definition at line 146 of file Sorted_set_.hpp.
auto cppx::set_intersection | ( | const unordered_set< Key > & | a, |
const unordered_set< Key > & | b | ||
) | -> Set_<Key> |
auto cppx::set_intersection | ( | const set< Key > & | a, |
const set< Key > & | b | ||
) | -> Sorted_set_<Key> |
Definition at line 125 of file Sorted_set_.hpp.
auto cppx::set_union | ( | const unordered_set< Key > & | a, |
const unordered_set< Key > & | b | ||
) | -> Set_<Key> |
auto cppx::set_union | ( | const set< Key > & | a, |
const set< Key > & | b | ||
) | -> Sorted_set_<Key> |
Definition at line 83 of file Sorted_set_.hpp.
auto cppx::set_union | ( | const set< Key > & | a, |
const Arg & | b | ||
) | -> Sorted_set_<Key> |
Definition at line 98 of file Sorted_set_.hpp.
auto cppx::set_union | ( | const unordered_set< Key > & | a, |
const Arg & | b | ||
) | -> Set_<Key> |
auto cppx::set_union | ( | const Arg & | a, |
const set< Key > & | b | ||
) | -> Sorted_set_<Key> |
Definition at line 103 of file Sorted_set_.hpp.
auto cppx::set_union | ( | const Arg & | a, |
const unordered_set< Key > & | b | ||
) | -> Set_<Key> |
|
inline |
Definition at line 23 of file string-util.hpp.
|
inline |
|
inline |
|
inline |
The square (second power) of the argument.
Definition at line 57 of file floating-point-operations.hpp.
|
inlinenoexcept |
The number of 1-bits in a std::bitset
.
Definition at line 18 of file sum_of_bits.hpp.
|
inlinenoexcept |
The number of 1-bits in an unsigned value.
Definition at line 24 of file sum_of_bits.hpp.
|
inline |
|
inline |
Definition at line 79 of file Abstract_source_location.hpp.
|
inline |
Definition at line 74 of file string-util.hpp.
|
inline |
Definition at line 94 of file string-util.hpp.
|
inline |
Definition at line 98 of file string-util.hpp.
|
inlinenoexcept |
Definition at line 61 of file Range_.hpp.
constexpr int cppx::bits_per_ = sizeof( Type )*bits_per_byte |
The number of bits per object/value of the specified type.
Definition at line 22 of file bits_per_.hpp.
const int cppx::bits_per_byte = CHAR_BIT |
Usually 8, but e.g. 16 on some DSPs.
Definition at line 18 of file bits_per_.hpp.
constexpr Truth cppx::check_the_execution_character_set = true |
Definition at line 9 of file config.hpp.
constexpr bool cppx::contains_type_ |
Definition at line 88 of file Type_list_.hpp.
constexpr bool cppx::contains_type_subset_ |
Definition at line 92 of file Type_list_.hpp.
const auto cppx::e = 2.71828182845904523536 |
Definition at line 42 of file named-numbers.hpp.
constexpr Raw_array_of_<1, const Char> cppx::empty_c_string = {} |
Definition at line 13 of file pointers-from-string_view.hpp.
constexpr T cppx::epsilon_ |
The difference between 1 and the least floating point value greater than 1.
The expression epsilon_<T>
is an alias for std::numeric_limits<T>::epsilon()
.
Definition at line 157 of file number-type-properties.hpp.
constexpr Truth cppx::has_infinity = has_infinity_<double> |
Definition at line 73 of file named-numbers.hpp.
constexpr Truth cppx::has_infinity_ = numeric_limits<double>::has_infinity |
Definition at line 71 of file named-numbers.hpp.
constexpr Truth cppx::has_method_empty_ = Has_method_empty_<Collection>::value |
Definition at line 30 of file is_empty.hpp.
Definition at line 59 of file named-numbers.hpp.
constexpr Truth cppx::has_nan_ = numeric_limits<Number>::has_quiet_NaN |
Definition at line 57 of file named-numbers.hpp.
const auto cppx::inv_sqrt2 = 0.707106781186547524401 |
Definition at line 54 of file named-numbers.hpp.
const auto cppx::inv_sqrt_pi = 1.12837916709551257390 |
Definition at line 52 of file named-numbers.hpp.
constexpr Truth cppx::is_a_ = is_same_type_<T, U> or is_base_and_derived_<T, U> |
Definition at line 37 of file basic-type-traits.hpp.
constexpr Truth cppx::is_a_byte_char_type_ = contains_type_<Char, Byte_char_types> |
Definition at line 45 of file type-traits.hpp.
constexpr Truth cppx::is_a_char_type_ = is_a_cpp11_char_type_<Char> |
Definition at line 39 of file type-traits.hpp.
constexpr Truth cppx::is_a_char_variant_type_ = contains_type_<Char, Char_variant_types> |
Definition at line 42 of file type-traits.hpp.
constexpr Truth cppx::is_a_cpp03_char_type_ = contains_type_<Char, Cpp03_char_literal_types> |
Definition at line 33 of file type-traits.hpp.
constexpr Truth cppx::is_a_cpp11_char_type_ = contains_type_<Char, Cpp11_char_literal_types> |
Definition at line 36 of file type-traits.hpp.
constexpr Truth cppx::is_base_and_derived_ = std::is_base_of_v<Base, Derived> |
Definition at line 31 of file basic-type-traits.hpp.
constexpr Truth cppx::is_class_ = std::is_class_v<T> |
Definition at line 45 of file basic-type-traits.hpp.
constexpr Truth cppx::is_const_ = std::is_const_v<std::remove_reference_t<T>> |
Definition at line 42 of file basic-type-traits.hpp.
constexpr Truth cppx::is_fixed_point_ = false |
Definition at line 48 of file basic-type-traits.hpp.
constexpr Truth cppx::is_floating_point_ = std::is_floating_point_v<T> |
Definition at line 51 of file basic-type-traits.hpp.
constexpr Truth cppx::is_ieee_754_ |
FP only. Whether the implementation claims to conform to the IEEE 754 standard.
is_ieee_754_<T>
is an alias for std::numeric_limits<T>::is_iec559
.
IEC 559 is just the European name of the IEEE 754 floating point standard.
Note that (at the writing of this documentation) both the Visual C++ and g++ compilers report IEEE 754 conformance when their fast-math options are used, which in particular causes incorrect NaN-checking, i.e. non-conformance.
Definition at line 91 of file number-type-properties.hpp.
constexpr Truth cppx::is_integral_ = std::is_integral_v<T> |
Definition at line 54 of file basic-type-traits.hpp.
constexpr Truth cppx::is_same_type_ = std::is_same_v<T, U> |
Definition at line 34 of file basic-type-traits.hpp.
constexpr Truth cppx::is_signed_ = std::is_signed_v<Int> |
Definition at line 57 of file basic-type-traits.hpp.
constexpr Truth cppx::is_unsigned_ = std::is_unsigned_v<Int> |
Definition at line 60 of file basic-type-traits.hpp.
constexpr T cppx::largest_ |
The largest representable-as-positive absolute value of the type.
largest_<T>
is an alias for std::numeric_limits<T>::max()
.
Definition at line 97 of file number-type-properties.hpp.
const auto cppx::ln10 = 2.30258509299404568402 |
Definition at line 46 of file named-numbers.hpp.
const auto cppx::ln2 = 0.693147180559945309417 |
Definition at line 45 of file named-numbers.hpp.
const auto cppx::log10e = 0.434294481903251827651 |
Definition at line 44 of file named-numbers.hpp.
const auto cppx::log2e = 1.44269504088896340736 |
Definition at line 43 of file named-numbers.hpp.
constexpr int cppx::magnitude_bits_per_ = numeric_limits<Type>::digits |
The number of bits that determine the magnitude, i.e. the number of value representation bits minus a sign bit, if any.
On 2019 computers this is generally bits_per_<Type> - std::is_signed_v<Type>
.
Definition at line 30 of file bits_per_.hpp.
constexpr T cppx::max_ |
The largest positive value of the type.
The expression max_<T>
is an alias for largest_<T>
.
Definition at line 110 of file number-type-properties.hpp.
constexpr int cppx::max_e_ |
FP only. E-notation maximum (largest positive) exponent value.
The expression max_e_<T>
is an alias for std::numeric_limits<T>::max_exponent10
.
Definition at line 126 of file number-type-properties.hpp.
constexpr T cppx::min_ |
The largest negative value of the type.
For integer T
the expression min_<T>
is an alias for std::numeric_limits<T>::min()
, which is usually/always -largest_<T> - 1
.
For floating point T
the expression min_<T>
is an alias for -largest_<T>
.
Definition at line 119 of file number-type-properties.hpp.
constexpr int cppx::min_e_ |
FP only. E-notation minimum (largest negative) exponent value.
The expression min_e_<T>
is an alias for std::numeric_limits<T>::min_exponent10
.
Definition at line 133 of file number-type-properties.hpp.
constexpr int cppx::n_digits_ |
Number of decimal digits that guaranteed can be represented.
The expression n_digits_<T>
is an alias for std::numeric_limits<T>::digits10
.
Definition at line 139 of file number-type-properties.hpp.
const auto cppx::pi = 3.14159265358979323846 |
Definition at line 47 of file named-numbers.hpp.
constexpr int cppx::radix_ |
FP only. The numeral system base of the floating point representation, 2 or 10.
The C++ standard requires integer types to be represented in binary, as either two's complement (now universal), ones' complement or sign and magnitude. From C++20 it will require two's complement form. However, it allows a floating point type to use a representation in some other numeral system such as 10, decimal.
The expression radix_<T>
is an alias for std::numeric_limits<T>::radix
.
Definition at line 151 of file number-type-properties.hpp.
constexpr T cppx::smallest_ |
The smallest non-zero absolute value of the type.
For integer T
this is just 1, and for floating point T
the expression smallest_<T>
is an alias for std::numeric_limits<T>::min()
.
Definition at line 104 of file number-type-properties.hpp.
const auto cppx::sqrt2 = 1.41421356237309504880 |
Definition at line 53 of file named-numbers.hpp.
const char cppx::std_ascii_bad_char = ascii::end_of_text |
Definition at line 64 of file ascii-character-names.hpp.
const wchar_t cppx::std_unicode_bad_char = L'\uFFFD' |
Definition at line 65 of file ascii-character-names.hpp.
constexpr Truth cppx::use_ascii_substitutes = false |
Definition at line 19 of file config.hpp.