API Reference: hate

template<size_t N, class WordType = unsigned long>
class hate::bitset
#include <bitset.h>

Constant-size bitset.

The bitset is accessible as array of unsigned integer words with configurable word-size. Logical operations are implemented for smaller-equal sized right-hand side bitsets. All logical operations are constexpr evaluable. The interface of std::bitset is to be mimicked for equal-sized operations as well as conversion to std::string and unsigned integer.

Template Parameters
  • N – Number of bits

  • WordType – Type of underlying word storage

Public Types

typedef WordType word_type

Public Functions

constexpr bitset()

Default construct bitset with all bits disabled.

template<size_t M, class OtherWordType>
constexpr bitset(bitset<M, OtherWordType> const &other)

Construct bitset from possibly differently sized bitset.

Not present bits in the other bitset will be set to false (M < N), bits not present in this instance are ignored (M > N).

Template Parameters
  • M – Size of bitset to construct instance from

  • OtherWordType – Type of underlying array of other bitset

Parameters

other – Bitset to construct instance from

template<size_t M>
constexpr bitset(std::array<word_type, M> const &value)

Construct bitset from array of words.

Parameters

value – Value to construct from

constexpr bitset(uintmax_t const &value)

Construct bitset from an unsigned integer.

Parameters

value – Value to construct from

constexpr bool all() const

Check if all bits are set to true.

Returns

Result of check

constexpr bool any() const

Check if any bit is set to true.

Returns

Result of check

constexpr bitset &flip()

Flip all bits.

Returns

Instance with all bits flipped.

constexpr bitset &flip(size_t index)

Flip bit.

Parameters

index – Index of bit to flip

Returns

Instance with bit flipped.

constexpr bool none() const

Check if no bit is set to true.

Returns

Result of check

explicit constexpr operator std::array<word_type, num_words> const&() const

Conversion operator to underlying array of words.

Returns

Array of words

explicit operator std::string() const

Conversion operator to string.

‘1’ represents a bit set to true, ‘0’ represents a bit set to false.

Returns

Bitset value as string

template<typename UIntegerType, typename = std::enable_if_t<std::is_unsigned<UIntegerType>::value>>
explicit constexpr operator UIntegerType() const

Conversion operator to unsigned integer.

If the bitset does not fit the integer, high bits are dropped.

Returns

Bitset value as unsigned integer

constexpr bool operator!=(bitset const &other) const

Inequality operator.

Parameters

other – Bitset to compare to

Returns

Result of comparison

template<size_t M>
constexpr bitset operator&(bitset<M, word_type> const &other) const

Perform & operation on bitset with smaller or equal sized other bitset.

Template Parameters

M – Size of other bitset

Parameters

other – Other bitset

Returns

(instance & other)

template<size_t M>
constexpr bitset<N, WordType> operator&(bitset<M, WordType> const &other) const
template<size_t M>
constexpr bitset &operator&=(bitset<M, word_type> const &other)

Perform &= operation on bitset with smaller or equal sized other bitset.

Template Parameters

M – Size of other bitset

Parameters

other – Other bitset

Returns

(instance &= other)

template<size_t M>
constexpr bitset<N, WordType> &operator&=(bitset<M, WordType> const &other)
constexpr bitset operator<<(size_t shift) const

Perform << operation on bitset.

Parameters

shift – Number of bits to shift right

Returns

(instance << shift)

constexpr bitset &operator<<=(size_t shift)

Perform <<= operation on bitset.

Parameters

shift – Number of bits to shift right

Returns

(instance <<= shift)

template<size_t M, class OtherWordType>
constexpr bitset &operator=(bitset<M, OtherWordType> const &other)

Assign bitset from possibly differently sized bitset.

Not present bits in the other bitset will be set to false (M < N), bits not present in this instance are ignored (M > N).

Template Parameters
  • M – Size of bitset to assign to instance

  • OtherWordType – Type of underlying array of other bitset

Parameters

other – Bitset to assign to instance

template<size_t M, class OtherWordType>
constexpr bitset<N, WordType> &operator=(bitset<M, OtherWordType> const &other)
constexpr bool operator==(bitset const &other) const

Equality operator.

Parameters

other – Bitset to compare to

Returns

Result of comparison

constexpr bitset operator>>(size_t shift) const

Perform >> operation on bitset.

Parameters

shift – Number of bits to shift right

Returns

(instance >> shift)

constexpr bitset &operator>>=(size_t shift)

Perform >>= operation on bitset.

Parameters

shift – Number of bits to shift right

Returns

(instance >>= shift)

template<size_t M>
constexpr bitset operator^(bitset<M, word_type> const &other) const

Perform ^ operation on bitset with smaller or equal sized other bitset.

Template Parameters

M – Size of other bitset

Parameters

other – Other bitset

Returns

(instance ^ other)

template<size_t M>
constexpr bitset<N, WordType> operator^(bitset<M, WordType> const &other) const
template<size_t M>
constexpr bitset &operator^=(bitset<M, word_type> const &other)

Perform ^= operation on bitset with smaller or equal sized other bitset.

Template Parameters

M – Size of other bitset

Parameters

other – Other bitset

Returns

(instance ^= other)

template<size_t M>
constexpr bitset<N, WordType> &operator^=(bitset<M, WordType> const &other)
template<size_t M>
constexpr bitset operator|(bitset<M, word_type> const &other) const

Perform | operation on bitset with smaller or equal sized other bitset.

Template Parameters

M – Size of other bitset

Parameters

other – Other bitset

Returns

(instance | other)

template<size_t M>
constexpr bitset<N, WordType> operator|(bitset<M, WordType> const &other) const
template<size_t M>
constexpr bitset &operator|=(bitset<M, word_type> const &other)

Perform |= operation on bitset with smaller or equal sized other bitset.

Template Parameters

M – Size of other bitset

Parameters

other – Other bitset

Returns

(instance |= other)

template<size_t M>
constexpr bitset<N, WordType> &operator|=(bitset<M, WordType> const &other)
constexpr bitset operator~() const

Create new instance with flipped bits.

Returns

New instance with all bits flipped.

constexpr bitset &reset()

Set all bits of bitset to false.

Returns

Instance with all bits set to false.

constexpr bitset &reset(size_t index)

Set bit of bitset to false.

Parameters

index – Index of bit to set

Returns

Instance with bit set to false.

constexpr bitset &set()

Set all bits of bitset to true.

Returns

Instance with all bits set to true.

constexpr bitset &set(size_t index, bool value = true)

Set bit of bitset to boolean value.

Parameters
  • index – Index of bit to set

  • value – Boolean value to set bit to

Returns

Instance with bit set to value.

constexpr bitset &shift_words_left(size_t word_shift)

Perform <<= operation on bitset for multiples of num_bits_per_word.

Parameters

word_shift – Number of words to shift

Returns

(instance <<= word_shift * num_bits_per_word)

constexpr bitset &shift_words_right(size_t word_shift)

Perform >>= operation on bitset for multiples of num_bits_per_word.

Parameters

word_shift – Number of words to shift

Returns

(instance >>= word_shift * num_bits_per_word)

constexpr bool test(size_t index) const

Get boolean value of bit.

Parameters

index – Index of bit to get

Returns

Boolean value of bit

constexpr std::array<word_type, num_words> const &to_array() const

Get underlying array of words.

Returns

Array of words

std::string to_string() const

Convert bitset to string.

‘1’ represents a bit set to true, ‘0’ represents a bit set to false.

Returns

Bitset value as string

constexpr uintmax_t to_uintmax() const

Convert bitset to maximal size unsigned integer.

If the bitset does not fit the integer, high bits are dropped.

Returns

Bitset value as maximal-sized unsigned integer

constexpr unsigned long long to_ullong() const

Convert bitset to unsigned long long integer.

If the bitset does not fit the integer, high bits are dropped.

Returns

Bitset value as unsigned long long integer

constexpr unsigned long to_ulong() const

Convert bitset to unsigned long integer.

If the bitset does not fit the integer, high bits are dropped.

Returns

Bitset value as unsigned long integer

Public Static Attributes

static constexpr size_t num_bits_per_word = sizeof(word_type) * CHAR_BIT
static constexpr size_t num_words = (N + num_bits_per_word - 1) / num_bits_per_word
static constexpr size_t size = N

Private Functions

constexpr void sanitize()

Sanitize the highest word to the possibly not full number of bits.

All bits at positions >= size % num_bits_per_word in the highest word are set to zero.

Private Members

std::array<word_type, num_words> m_words

Private Static Functions

static constexpr word_type highest_word_bitmask()

Generate bitmask of the used bits in the highest word.

Returns

Bitmask

Friends

friend class bitset
template<typename T>
struct hate::detail::add_empty
#include <empty.h>

Public Types

typedef Empty<T> type
template<typename T>
struct hate::detail::add_empty<Empty<T>>
#include <empty.h>

Public Types

typedef Empty<T> type
template<typename Ta, typename Tb>
struct concat
template<typename ...Ta, typename ...Tb>
struct hate::detail::concat<type_list<Ta...>, type_list<Tb...>>
#include <type_list.h>

Public Types

using type = type_list<Ta..., Tb...>
template<typename Default, typename AlwaysVoid, template<typename...> typename Op, typename ...Args>
struct hate::detail::detector
#include <type_traits.h>

Helpers for is_detected, detected_t and detected_or (will be provided by TS2 in the future)

Public Types

using type = Default
using value_t = std::false_type
template<typename Default, template<typename...> typename Op, typename ...Args>
struct hate::detail::detector<Default, std::void_t<Op<Args...>>, Op, Args...>
#include <type_traits.h>

Public Types

using type = Op<Args...>
using value_t = std::true_type
template<typename T>
struct is_empty : public std::false_type
#include <empty.h>
template<typename T>
struct is_empty<Empty<T>> : public std::true_type
#include <empty.h>
template<typename ...Ts>
struct is_in_type_list : public std::false_type
#include <type_list.h>
template<typename T, typename ...Us>
struct hate::detail::is_in_type_list<T, type_list<Us...>>
#include <type_list.h>

Check if type is in type_list.

Public Static Attributes

static constexpr bool value = detail::is_in_type_list<T, Us...>::value
template<typename T, typename U, typename ...Us>
struct hate::detail::is_in_type_list<T, U, Us...>
#include <type_list.h>

Public Static Attributes

static constexpr const bool value = std::is_same<T, U>::value || is_in_type_list<T, Us...>::value
template<typename ...TLs>
struct multi_concat
template<typename FirstTL, typename ...TLs>
struct hate::detail::multi_concat<FirstTL, TLs...>
#include <type_list.h>

Public Types

using type = typename multi_concat<FirstTL, typename multi_concat<TLs...>::type>::type
template<typename LastTL>
struct hate::detail::multi_concat<LastTL>
#include <type_list.h>

Public Types

using type = LastTL
template<typename One, typename Two>
struct hate::detail::multi_concat<One, Two>
#include <type_list.h>

Public Types

using type = concat_t<One, Two>
template<typename T>
struct hate::detail::remove_all_qualifiers
#include <type_traits.h>

Public Types

typedef T type
template<typename T>
struct hate::detail::remove_all_qualifiers<T&>
#include <type_traits.h>

Public Types

typedef remove_all_qualifiers<T>::type type
template<typename T>
struct hate::detail::remove_all_qualifiers<T&&>
#include <type_traits.h>

Public Types

typedef remove_all_qualifiers<T>::type type
template<typename T>
struct hate::detail::remove_all_qualifiers<T*>
#include <type_traits.h>

Public Types

typedef remove_all_qualifiers<T>::type type
template<typename T>
struct hate::detail::remove_all_qualifiers<T const>
#include <type_traits.h>

Public Types

typedef remove_all_qualifiers<T>::type type
template<typename T>
struct hate::detail::remove_all_qualifiers<T volatile const>
#include <type_traits.h>

Public Types

typedef remove_all_qualifiers<T>::type type
template<typename T>
struct hate::detail::remove_all_qualifiers<T volatile>
#include <type_traits.h>

Public Types

typedef remove_all_qualifiers<T>::type type
template<typename T>
struct hate::detail::remove_empty
#include <empty.h>

Public Types

typedef T type
template<typename T>
struct hate::detail::remove_empty<Empty<T>>
#include <empty.h>

Public Types

typedef T type
template<typename T>
struct to_false_type : public std::false_type
#include <type_list.h>
template<typename T, typename ...Ts>
struct hate::detail::type_list_make_unique
#include <type_list.h>

Public Types

typedef hate::multi_concat_t<std::conditional_t<hate::is_in_type_list<T, hate::type_list<Ts...>>::value, hate::type_list<>, hate::type_list<T>>, typename type_list_make_unique<Ts...>::type> type
template<typename T>
struct hate::detail::type_list_make_unique<T>
#include <type_list.h>

Public Types

typedef hate::type_list<T> type
template<typename T>
struct hate::Empty
#include <empty.h>

Empty structure wrapping type.

Template Parameters

T – Type to wrap

Public Types

typedef T type

Public Functions

inline Empty()
template<template<typename> typename Filter, typename TL>
struct filter_type_list

Apply given filter to type_list.

Template Parameters
  • Filter – Filter generating boolean value for each type in type_list

  • TLtype_list to filter

template<template<typename> typename Filter, typename T, typename ...Ts>
struct hate::filter_type_list<Filter, hate::type_list<T, Ts...>>
#include <type_list.h>

Public Types

typedef std::conditional_t<Filter<T>::value, hate::multi_concat_t<hate::type_list<T>, typename filter_type_list<Filter, hate::type_list<Ts...>>::type>, typename filter_type_list<Filter, hate::type_list<Ts...>>::type> type
template<template<typename> typename Filter>
struct hate::filter_type_list<Filter, hate::type_list<>>
#include <type_list.h>

Public Types

typedef hate::type_list type
template<typename T>
class hate::has_iterator
#include <iterator_traits.h>

Implementation of a trait checking for “T::iterator”.

Public Types

typedef T type
std::integral_constant< bool, sizeof(test< T >(0))==sizeof(yes)> value_type

Public Static Attributes

static const bool value = sizeof(test<T>(0)) == sizeof(yes)

Private Types

typedef char yes

Private Static Functions

template<typename C>
static no test(...)
template<typename C>
static yes test(typename C::iterator*)
struct hate::has_iterator::no

Public Members

char array[2]
struct hate::Indentation
#include <indent.h>

Add indentation to multi-line string.

The indentation is added after every line break.

Public Functions

Indentation() = default
Indentation(std::string value) __attribute__((visibility("default")))

Construct indentation with specified value.

Parameters

value – Value to add after every line break

Private Members

std::string m_value

Friends

friend std::ostream &operator<<(std::ostream &os, Indentation const &value) __attribute__((visibility("default")))
struct hate::IndentingOstream : private std::streambuf, public std::ostream
#include <indent.h>

Ostream wrapper which allows additing indentation on every line-break.

Public Functions

IndentingOstream(std::ostream &os) __attribute__((visibility("default")))

Protected Functions

virtual int overflow(int c) override
virtual std::streamsize xsputn(const char *s, std::streamsize count) override

Private Members

std::string m_indentation
bool m_insert_indentation
std::ostream &m_os

Friends

friend std::ostream &operator<<(std::ostream &os, Indentation const &value) __attribute__((visibility("default")))
template<size_t I, typename TL>
struct index_type_list_by_integer
#include <type_list.h>

Calculate the type of an index in a type_list.

Note

Bounds checking is performed.

Returns

The type of a 0-based index.

template<size_t I, typename ...Ts>
struct hate::index_type_list_by_integer<I, type_list<Ts...>>
#include <type_list.h>

Public Types

using type = typename std::tuple_element<I, std::tuple<Ts...>>::type
template<typename T, typename TL>
struct index_type_list_by_type
#include <type_list.h>

Calculate the index of a type in a type_list.

Note

Duplicates and non-existing type yield static_asserts.

Returns

The 0-based index of the type.

template<typename T, typename ...Ts>
struct hate::index_type_list_by_type<T, type_list<T, Ts...>>
#include <type_list.h>

Public Static Attributes

static constexpr size_t value = 0
template<typename T, typename U, typename ...Ts>
struct hate::index_type_list_by_type<T, type_list<U, Ts...>>
#include <type_list.h>

Public Static Attributes

static constexpr size_t value = 1 + index_type_list_by_type<T, type_list<Ts...>>::value
template<typename T, typename = void>
struct is_container : public std::false_type
#include <type_traits.h>

Check if a type adheres to the Container concept.

Template Parameters

T – Type to check

template<typename T>
struct is_container<T, std::void_t<typename T::value_type, typename T::size_type, typename T::allocator_type, typename T::iterator, typename T::const_iterator, decltype(std::declval<T>().size()), decltype(std::declval<T>().begin()), decltype(std::declval<T>().end()), decltype(std::declval<T>().cbegin()), decltype(std::declval<T>().cend())>> : public std::true_type
#include <type_traits.h>
template<typename T, template<typename...> class U>
struct is_specialization_of : public std::false_type
#include <iterator_traits.h>

Check if some type is a specialization of another type.

Note

This won’t work correctly with non-type parameters :(.

template<template<typename...> class U, typename ...Args>
struct is_specialization_of<U<Args...>, U> : public std::true_type
#include <iterator_traits.h>
template<typename T>
struct is_type_list : public std::false_type
#include <type_list.h>

The corresponding type_list trait.

template<typename ...Ts>
struct is_type_list<type_list<Ts...>> : public std::true_type
#include <type_list.h>
template<typename IteratorT, typename DelimiterT>
struct hate::Join
#include <join.h>

Object which is serializable into an ostream by joining an iterator range of entries with delimiter in-between.

Template Parameters
  • IteratorT – Type of begin/end iterators

  • DelimiterT – Type of delimiter

Parameters
  • begin – Iterator pointing to begin

  • end – Iterator pointing to end

  • delimiter – Delimiter to insert between iterable elements

Public Members

IteratorT begin
DelimiterT delimiter
IteratorT end
template<typename IteratorT, typename DelimiterT, typename FunctorT>
struct hate::JoinTransformed
#include <join.h>

Object which is serializable into an ostream by joining an iterator range of entries with delimiter in-between.

A transformation is applied to each entry prior to serialization.

Template Parameters
  • IteratorT – Type of begin/end iterators

  • DelimiterT – Type of delimiter

  • FunctorT – Type of transformation, is required to be callable with *IteratorT as argument type

Parameters
  • begin – Iterator pointing to begin

  • end – Iterator pointing to end

  • delimiter – Delimiter to insert between iterable elements

  • functor – Transformation to apply to each element of iterator range

Public Members

IteratorT begin
DelimiterT delimiter
IteratorT end
FunctorT functor
struct hate::MultidimIterator

Public Functions

inline MultidimIterator(std::vector<int64_t> const &range)
inline MultidimIterator end() const
inline bool operator!=(MultidimIterator const &other) const
inline std::vector<int64_t> const &operator*() const
inline MultidimIterator &operator++()
inline bool operator==(MultidimIterator const &other) const

Private Members

std::vector<int64_t> m_range
std::vector<int64_t> m_state
struct Nil
#include <nil.h>

Empty structure to be used in APIs where a type is expected, but no reasonable implementation can be provided.

struct hate::nonesuch
#include <type_traits.h>

nonesuch cannot be constructed, destroyed, or copied.

(future TS2)

Public Functions

nonesuch() = delete
nonesuch(nonesuch const&) = delete
~nonesuch() = delete
void operator=(nonesuch const&) = delete
template<class ...Ts>
struct overloaded : public hate::Ts
#include <variant.h>
template<typename ...Ts>
class Passkey

Implementation of the passkey idiom that allows to give specific classes access to private members.

template<typename T, typename ...Ts>
class hate::Passkey<T, Ts...> : public hate::Passkey<Ts...>
#include <passkey.h>

Protected Attributes

friend T
template<>
class hate::Passkey<>
#include <passkey.h>

Protected Functions

inline Passkey()
Passkey(Passkey const &passkey) = default
Passkey &operator=(Passkey const&) = delete
template<typename T>
struct hate::remove_all_qualifiers
#include <type_traits.h>

Remove arbitrary combinations of pointer, reference and const/volatile qualifiers from a type.

Template Parameters

T – Type to remove all qualifiers from

Public Types

typedef detail::remove_all_qualifiers<T>::type type
class hate::Timer
#include <timer.h>

Public Functions

inline Timer()
inline long get_ms() const
inline long get_ns() const
inline long get_s() const
inline long get_us() const
inline std::string print() const

Private Members

std::chrono::microseconds m_start

Private Static Functions

static inline std::chrono::microseconds fast_now()
template<typename T>
class hate::TrackModifications

Simple wrapper that tracks whenever the wrapped object gets modified.

Because on a non-const object, the compiler will always choose the non-const version of a method, we cannot overload operator*().

Hence we use operator*() for read-only modified and request modification via get().

Public Types

using value_type = T

Public Functions

template<typename ...Args>
inline explicit TrackModifications(Args&&... args)
inline TrackModifications(TrackModifications &&other)
inline TrackModifications(TrackModifications const &other)
inline auto elapsed() const

Get elapsed time since last modification.

inline std::add_lvalue_reference_t<value_type> get()

Request to modify wrapped value.

template<typename Duration>
inline bool is_elapsed(Duration const &duration) const

Check if the given duration has elapsed.

inline std::add_lvalue_reference_t<value_type const> operator*() const

Get read-only modified to wrapped value.

modified is not tracked.

inline TrackModifications &operator=(TrackModifications &&other)
inline TrackModifications &operator=(TrackModifications const &other)

Private Functions

inline void modified()

Private Members

std::atomic<std::chrono::system_clock::time_point> m_last_access
value_type m_wrapped
template<typename ...Ts>
struct type_list
#include <type_list.h>

type_list contains a variadic type list.

template<typename FromT>
struct type_list_from
#include <type_list.h>

convert other types to typelist.

template<template<typename...> class FromT, typename ...Ts>
struct hate::type_list_from<FromT<Ts...>>
#include <type_list.h>

Public Types

using type = type_list<Ts...>
template<typename TL1, typename TL2>
struct hate::type_list_intersection
#include <type_list.h>

Apply type intersection to type_list pair.

Template Parameters

Public Types

template<typename T>
using filter = is_in_type_list<T, TL2>
typedef filter_type_list_t<filter, TL1> type
template<typename TL>
struct type_list_size
#include <type_list.h>

Calculate the size of a type_list.

Note

Duplicate types are counted.

Returns

Number of entries in type_list.

template<typename ...Ts>
struct hate::type_list_size<type_list<Ts...>>
#include <type_list.h>

Public Static Attributes

static constexpr size_t value = sizeof...(Ts)
template<template<typename...> class, typename TL>
struct type_list_to
#include <type_list.h>

convert type_list to any variadic data-type

template<template<typename...> class TargetT, typename ...Ts>
struct hate::type_list_to<TargetT, type_list<Ts...>>
#include <type_list.h>

Public Types

using type = TargetT<Ts...>
template<typename TL>
struct type_list_unique

Reduce type list to unique types.

Parameters

TL – Type list to reduce

template<typename ...Ts>
struct hate::type_list_unique<hate::type_list<Ts...>>
#include <type_list.h>

Public Types

typedef detail::type_list_make_unique<Ts...>::type type
template<>
struct hate::type_list_unique<hate::type_list<>>
#include <type_list.h>

Public Types

typedef hate::type_list type
template<typename T>
struct std::remove_cvref
#include <type_traits.h>

Public Types

typedef std::remove_cv_t<std::remove_reference_t<T>> type
namespace hate

Typedefs

template<typename T>
using add_empty_t = typename detail::add_empty<T>::type

Add an Empty wrapper to given type if not already an Empty wrapper is given.

Template Parameters

T – Type to add Empty to

template<typename ...Ts>
using concat_t = typename detail::concat<Ts...>::type

Concatenation of the types of two type_list types into a new type_list (left to right).

template<class Default, template<class...> class Op, class ...Args>
using detected_or = detail::detector<Default, void, Op, Args...>
template<class Default, template<class...> class Op, class ...Args>
using detected_or_t = typename detected_or<Default, Op, Args...>::type
template<template<class...> class Op, class ...Args>
using detected_t = typename detail::detector<nonesuch, void, Op, Args...>::type
template<template<typename> typename Filter, typename TL>
using filter_type_list_t = typename filter_type_list<Filter, TL>::type
template<template<class...> class Op, class ...Args>
using is_detected = typename detail::detector<nonesuch, void, Op, Args...>::value_t

detection types which will be provided by TS2

template<class To, template<class...> class Op, class ...Args>
using is_detected_convertible = std::is_convertible<detected_t<Op, Args...>, To>
template<class Expected, template<class...> class Op, class ...Args>
using is_detected_exact = std::is_same<Expected, detected_t<Op, Args...>>
template<typename ...Ts>
using is_in_type_list = detail::is_in_type_list<Ts...>
template<typename ...Ts>
using multi_concat_t = typename detail::multi_concat<Ts...>::type

Concatenation of N type_list types into a single type_list.

using nullopt_t = std::experimental::nullopt_t
template<typename T>
using optional = std::experimental::optional<T>
template<typename T>
using remove_all_qualifiers_t = typename remove_all_qualifiers<T>::type
template<typename T>
using remove_empty_t = typename detail::remove_empty<T>::type

Remove Empty wrapper of given type if it is of form Empty<U>.

Template Parameters

T – Type to remove Empty from

template<typename ...Ts>
using type_list_from_t = typename type_list_from<Ts...>::type
template<typename TL1, typename TL2>
using type_list_intersection_t = typename type_list_intersection<TL1, TL2>::type
template<template<typename...> class TargetT, typename TL>
using type_list_to_t = typename type_list_to<TargetT, TL>::type
template<typename TL>
using type_list_unique_t = typename type_list_unique<TL>::type

Functions

template<typename MapT>
std::optional<std::reference_wrapper<typename MapT::mapped_type const>> cget(MapT const &map, typename MapT::key_type const &key)

Unified getter for unordered_map that returns an optional.

Constant variant.

Parameters
  • map – Map from which to get value.

  • key – Key for value.

Returns

Optional that contains const reference to value if contained in map, nullopt otherwise.

template<template<typename> typename Optional, typename T1, typename T2>
bool compare_optional_equal(Optional<T1> a, Optional<T2> b, bool const fall_back)

Checks the equality of two variables of optional type.

If both variables hold values the function returns the boolean equality comparison of the two values. In case of at least one the values is absent the fall-back-value is returned.

Parameters
  • a – First value to be compared.

  • b – Second value do be compared.

  • fall_back – Boolean value to be returned if a or b is uninitialized.

Returns

Equality comparison of a and b if both hold values, fall-back-value otherwise.

template<class T>
constexpr T fill_bits(size_t max_index)

Create bitmask with bits set to true up to (including) a specified index.

Template Parameters
  • T – Type of bitmask

  • max_index – Index up to which to set bits to true

template<typename F, typename Head, typename ...Tuples>
auto for_each(F &&f, Head &&head, Tuples&&... tuples)

Apply given function to arguments from tuples in order.

Template Parameters
  • F – Function to for_each

  • Head – First tuple to get input from

  • Tuples – Other tuples to get input from

Returns

Tuple of results of function invokation for all tuple elements

template<typename T>
std::string full_name()

Get fully qualified name of a type including namespaces.

The format follows “name::space::Type::SubType<TParams…>”.

Template Parameters

T – Type to get name for

template<typename MapT>
std::optional<std::reference_wrapper<typename MapT::mapped_type>> get(MapT &map, typename MapT::key_type const &key)

Unified getter for unordered_map that returns an optional.

Parameters
  • map – Map from which to get value.

  • key – Key for value.

Returns

Optional that contains reference to value if contained in map, nullopt otherwise.

template<typename T>
bool has_intersection(std::set<T> const &a, std::set<T> const &b)
template<typename T>
bool has_intersection(std::vector<T> const &a, std::vector<T> const &b)
template<typename IterableT, typename DelimiterT>
auto join(IterableT &&iterable, DelimiterT &&delimiter)

Create object which is serializable by joining an iterable with delimiter in-between.

Template Parameters
  • IterableT – Type of iterable

  • DelimiterT – Type of delimiter

Parameters
  • iterable – Iterable to join

  • delimiter – Delimiter to insert between iterable elements

template<typename IterableT, typename DelimiterT, typename FunctorT>
auto join(IterableT &&iterable, DelimiterT &&delimiter, FunctorT &&functor)

Create object which is serializable by joining an iterable of entries with delimiter in-between and applying transformation prior to serialization.

Template Parameters
  • IterableT – Type of iterable

  • DelimiterT – Type of delimiter

  • FunctorT – Type of transformationm, is required to be callable with any element of IterableT

Parameters
  • iterable – Iterable to join

  • delimiter – Delimiter to insert between iterable elements

  • functor – Transformation to apply to each element of iterator range

template<typename IteratorT, typename DelimiterT>
Join<IteratorT, DelimiterT> join(IteratorT &&begin, IteratorT &&end, DelimiterT &&delimiter)

Create object which is serializable by joining an iterator range of entries with delimiter in-between.

Template Parameters
  • IteratorT – Type of begin/end iterators

  • DelimiterT – Type of delimiter

Parameters
  • begin – Iterator pointing to begin

  • end – Iterator pointing to end

  • delimiter – Delimiter to insert between iterable elements

template<typename IteratorT, typename DelimiterT, typename FunctorT>
JoinTransformed<IteratorT, DelimiterT, FunctorT> join(IteratorT &&begin, IteratorT &&end, DelimiterT &&delimiter, FunctorT &&functor)

Create object which is serializable by joining an iterator range of entries with delimiter in-between and applying transformation prior to serialization.

Template Parameters
  • IteratorT – Type of begin/end iterators

  • DelimiterT – Type of delimiter

  • FunctorT – Type of transformation, is required to be callable with *IteratorT as argument type

Parameters
  • begin – Iterator pointing to begin

  • end – Iterator pointing to end

  • delimiter – Delimiter to insert between iterable elements

  • functor – Transformation to apply to each element of iterator range

template<typename IterableT, typename DelimiterT>
std::string join_string(IterableT const &iterable, DelimiterT const &delimiter)

Join iterable to string with delimiter in-between.

Template Parameters
  • IterableT – Type of iterable

  • DelimiterT – Type of delimiter

Parameters
  • iterable – Iterable instance to join

  • delimiter – Delimiter to use in-between

template<typename IteratorT, typename DelimiterT>
std::string join_string(IteratorT const &begin, IteratorT const &end, DelimiterT const &delimiter)

Join iterable to string with delimiter in-between.

Template Parameters
  • IteratorT – Iterator type

  • DelimiterT – Type of delimiter

Parameters
  • begin – Iterator pointing to begin

  • end – Iterator pointing to end

  • delimiter – Delimiter to use in-between

template<typename T>
std::string name()

Get name of a type stripped of namespaces and surrounding classes.

The format follows “SubType<TParams…>” for name::space::Type::SubType<Tparams…>.

Template Parameters

T – Type to get name for

template<size_t N, class WordType>
std::ostream &operator<<(std::ostream &os, bitset<N, WordType> const &value)
template<typename IteratorT, typename DelimiterT>
std::ostream &operator<<(std::ostream &os, Join<IteratorT, DelimiterT> const &value)
template<typename IteratorT, typename DelimiterT, typename FunctorT>
std::ostream &operator<<(std::ostream &os, JoinTransformed<IteratorT, DelimiterT, FunctorT> const &value)
template<class ...Ts>
overloaded(Ts...) -> overloaded<Ts...>
template<int Precision = 3, typename Rep, typename Period>
std::string to_string(std::chrono::duration<Rep, Period> const &value)

Convert duration with specified minimal precision for nano-, micro-, milli- or seconds to string.

The correct metric prefix is chosen for the unit print. The precision states the minimal number of digits to be printed, only above 1000s the number of digits is increased. Not printed characters are discarded without looking at rounding.

Template Parameters
  • precision – Number of digits to print (minimally, defaults to 3 to be aligned with metric prefix steps)

  • Rep – Representation type used in duration

  • Period – Period specifier of duration

Parameters

value – Duration value to print

Variables

template<typename T>
static constexpr bool is_container_v = is_container<T>::value
template<class To, template<class...> class Op, class ...Args>
constexpr bool is_detected_convertible_v = is_detected_convertible<To, Op, Args...>::value
template<class Expected, template<class...> class Op, class ...Args>
constexpr bool is_detected_exact_v = is_detected_exact<Expected, Op, Args...>::value
template<template<class...> class Op, class ...Args>
constexpr bool is_detected_v = is_detected<Op, Args...>::value
template<typename T>
static constexpr bool is_empty_v = detail::is_empty<T>::value

Get whether given type is an Empty type.

Template Parameters

T – Type to check

constexpr std::experimental::nullopt_t const &nullopt = std::experimental::nullopt
namespace hate::detail

Functions

template<size_t Position, typename F, typename ...Tuples>
auto for_each(F &&f, Tuples&&... tuples)

Apply given function to arguments from tuples at given position.

Template Parameters
  • Position – Position to get tuple elements from

  • F – Function to for_each

  • Tuples – Tuples to get elements from

Returns

Result of function invokation

template<size_t FirstPosition, size_t... Positions, typename F, typename ...Tuples>
auto for_each(std::integer_sequence<size_t, FirstPosition, Positions...> const&, F &&f, Tuples&&... tuples)

Apply given function to arguments from tuples in order of positions given by sequence.

Template Parameters
  • Positions – Positions to get tuple elements from

  • F – Function to for_each

  • Tuples – Tuples to get elements from

Returns

Tuple of results of function invokation at given positions

template<typename Head, typename ...Tuples>
constexpr bool has_equal_tuple_size()

Get whether given tuples have equal size.

Template Parameters
  • Head – First tuple

  • Tuples – Other tuples

Returns

Boolean value

template<size_t Size, typename Head, typename ...Tuples>
constexpr bool has_tuple_size()

Get whether given tuples have given size.

Template Parameters
  • Size – Size to check against

  • Head – First tuple

  • Tuples – Other tuples

Returns

Boolean value

template<class T>
constexpr T recurse_fill_bits(T cur, size_t max, size_t pos)

Recursively set an index-range of bits to true.

Template Parameters

T – Return type of bitmask

Parameters
  • cur – Current bitmask

  • max – Maximal index to set to true

  • pos – Current index position

namespace hate::math

Functions

constexpr size_t log2(size_t value)

Calculate the logarithm to the power of two of an integer value.

Parameters

value – Value to calculate log2 for

constexpr size_t num_bits(size_t n)

Calculates the minimal number of bits needed to store the integer.

Parameters

n – Integer number

Returns

Result of calculation

constexpr size_t pow(size_t base, size_t exp)

Calculate the power of an integer value.

Parameters
  • base – Base value

  • exp – Exponent value

constexpr size_t round_up_integer_division(size_t number, size_t divisor)

Calculates the integer division rounded up.

Parameters
  • number – Number to calculate division for

  • divisor – Divisor

Returns

Result of division

constexpr size_t round_up_to_multiple(size_t number, size_t multiple)

Rounds up a number to full multiples.

Parameters
  • number – Number to round up

  • multiple – Multiple to use as base for rounding

Returns

Rounded number

namespace hate::memory

Functions

template<typename T, typename Tuple>
std::shared_ptr<T> make_shared_from_tuple(Tuple &&t)
template<typename T, typename Tuple>
std::unique_ptr<T> make_unique_from_tuple(Tuple &&t)
namespace hate::memory::detail

Functions

template<typename T, typename Tuple, size_t... I>
std::shared_ptr<T> make_shared_from_tuple_impl(Tuple &&t, std::index_sequence<I...>)
template<typename T, typename Tuple, size_t... I>
std::unique_ptr<T> make_unique_from_tuple_impl(Tuple &&t, std::index_sequence<I...>)
namespace std

STL namespace.

Typedefs

template<typename T>
using remove_cvref_t = typename remove_cvref<T>::type
file algorithm.h
#include <>
#include <>
file bitset.h
#include <>
#include <>
#include <>
#include <>
#include <>
#include <>
#include <>
file empty.h
#include <>
file indent.h
#include “hate/visibility.h
#include <>
#include <>
file iterator_traits.h
#include <>
file join.h
#include <>
#include <>
#include <>
#include <>
file macros.h

Defines

HATE_LIKELY(x)
HATE_UNLIKELY(x)
file math.h
#include <>
file memory.h
#include <>
#include <>
#include <>
file multidim_iterator.h
#include <>
#include <>
file nil.h
file optional.h
#include <>
file passkey.h
file timer.h
#include <>
#include <>
#include <>
#include <>
#include <>
#include <>
file track_modifications.h
#include <>
#include <>
#include <>
#include <>
file tuple.h
#include “hate/nil.h
#include <>
#include <>
#include <>
#include <>
#include <>
file type_index.h
#include <>
file type_list.h
#include <>
#include <>

This header contains helper classes for handling C++ (variadic) type lists.

file type_traits.h
#include <>
file unordered_map.h
#include <>
#include <>
#include <>
file variant.h
file visibility.h

Defines

SYMBOL_HIDDEN
SYMBOL_VISIBLE
dir /jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTI4MDc.x/hate
dir /jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTI4MDc.x/hate/include/hate
dir /jenkins/jenlib_workspaces_f9/doc_gerrit_documentation-brainscales2-dependencies.ZG9jX2dlcnJpdF9kb2N1bWVudGF0aW9uLWJyYWluc2NhbGVzMi1kZXBlbmRlbmNpZXMjMTI4MDc.x/hate/include