halcheck 1.0
Loading...
Searching...
No Matches
halcheck::lib Namespace Reference

General utility library. More...

Classes

class  any
 An implemenetation of std::any. More...
 
struct  bad_any_cast
 An implementation of std::bad_any_cast. More...
 
struct  bad_optional_access
 An implementation of std::bad_optional_access. More...
 
struct  conjunction
 An implementation of std::conjunction. More...
 
struct  constructor
 A function object that calls the constructor of a given type. More...
 
class  dag
 Directed acyclic graphs with labelled nodes. More...
 
struct  disable_sized_range
 Indicates whether lib::size should be disabled for a type. More...
 
struct  disjunction
 An implementation of std::disjunction. More...
 
class  effect
 Provides operations for simulating scoped-algebraic effects (a.k.a. resumable exceptions.) More...
 
struct  enable_borrowed_range
 An implementation of std::ranges::enable_borrowed_range. More...
 
class  filter_iterator
 An iterator adaptor that skips elements that do not satisfy user-defined predicate. More...
 
class  finally_t
 Calls a function upon destruction. More...
 
class  function_view< R(Args...) const >
 Represents a const reference to a function object. More...
 
class  function_view< R(Args...)>
 Represents a reference to a function object. More...
 
struct  ignore_t
 The type of lib::ignore. More...
 
struct  in_place_t
 An implementation of std::in_place_t. More...
 
class  index_iterator
 An iterator into a random-access range that is invalidated if and only if the index of the pointed-to element changes. More...
 
struct  integer_sequence
 An implementation of std::integer_sequence. More...
 
struct  iota_diff
 Computes a type large enough to contain the difference between two instances of an iterator. More...
 
class  iota_iterator
 An iterator pointing to an integral value. More...
 
struct  is_bidirectional_iterator
 Determines whether a type satisfies the LegacyBidirectionalIterator concept. More...
 
struct  is_bidirectional_range
 Determines whether a type is a range whose iterators satisfy lib::is_bidirectional_iterator. More...
 
struct  is_boolean_testable
 Determines if a type is satisfies the boolean-testable concept. More...
 
struct  is_brace_constructible
 Determines if a type is constructible from a given set of argument types using initiailizer-list-style construction. More...
 
struct  is_copyable
 Determines if a type is copy constructible and copy assignable. More...
 
struct  is_detected
 An implementation of std::experimental::is_detected. More...
 
struct  is_effect
 Determines if a given type is an effect. More...
 
struct  is_equality_comparable
 Determines if a type satisfies the EqualityComparable concept. More...
 
struct  is_forward_iterator
 Determines whether a type satisfies the LegacyForwardIterator concept. More...
 
struct  is_forward_range
 Determines whether a type is a range whose iterators satisfy lib::is_forward_iterator. More...
 
struct  is_hashable
 Determines if a type has a valid std::hash specialization. More...
 
struct  is_input_iterator
 Determines whether a type satisfies the LegacyInputIterator concept. More...
 
struct  is_input_range
 Determines whether a type is a range whose iterators satisfy lib::is_input_iterator. More...
 
struct  is_insertable_range
 Determines whether a range is insertable. More...
 
struct  is_invocable
 An implementation of std::is_invocable. More...
 
struct  is_invocable_r
 An implementation of std::is_invocable_r. More...
 
struct  is_iterator
 Determines whether a type satisfies the LegacyIterator concept. More...
 
struct  is_movable
 Determines if a type is move constructible and move assignable. More...
 
struct  is_nothrow_invocable
 An implementation of std::is_nothrow_invocable. More...
 
struct  is_nothrow_invocable_r
 An implementation of std::is_nothrow_invocable_r. More...
 
struct  is_nothrow_swappable
 An implementation of std::is_nothrow_swappable. More...
 
struct  is_output_iterator
 Determines whether a type satisfies the LegacyOutputIterator concept. More...
 
struct  is_parsable
 Determines whether a type is parsable (i.e. can be read from a std::basic_istream ). More...
 
struct  is_printable
 Determines whether a type is printable (i.e. can be output on a std::basic_ostream ). More...
 
struct  is_random_access_iterator
 Determines whether a type satisfies the LegacyRandomAccessIterator concept. More...
 
struct  is_random_access_range
 Determines whether a type is a range whose iterators satisfy lib::is_random_access_iterator. More...
 
struct  is_range
 Determines whether the given type is a range. More...
 
struct  is_sized_range
 Determines whether a range type supports the lib::size operation. More...
 
struct  is_specialization_of
 Determines if a type is a specialization of a template class. More...
 
struct  is_swappable
 An implementation of std::is_swappable. More...
 
class  iterator_interface
 A utility class for easily defining new iterators. More...
 
struct  make_integer_sequence
 An implementation of std::make_integer_sequence. More...
 
class  move_only_function< R(Args...) & >
 An implementation of std::move_only_function. More...
 
class  move_only_function< R(Args...) && >
 An implementation of std::move_only_function. More...
 
class  move_only_function< R(Args...) const & >
 An implementation of std::move_only_function. More...
 
class  move_only_function< R(Args...) const && >
 An implementation of std::move_only_function. More...
 
class  move_only_function< R(Args...) const >
 An implementation of std::move_only_function. More...
 
class  move_only_function< R(Args...)>
 An implementation of std::move_only_function. More...
 
struct  nullopt_t
 An implementation of std::nullopt_t. More...
 
class  number
 A number is conceptually a signed integer with constant time equality comparison and hashing. More...
 
class  optional
 An implementation of std::optional. More...
 
struct  optional< const void >
 A specialization of optional for "const void". More...
 
struct  optional< const volatile void >
 A specialization of optional for "const volatile void". More...
 
struct  optional< void >
 A specialization of optional for "void". More...
 
struct  optional< volatile void >
 A specialization of optional for "volatile void". More...
 
struct  overload
 Represents an overload set as a single value. More...
 
struct  raise
 A type for values that do not exist. More...
 
class  subrange
 Describes a range formed from a pair of iterators. More...
 
class  symbol
 A symbol is conceptually a std::string with constant time equality comparison and hashing. More...
 
class  transform_iterator
 A transforming iterator adaptor. More...
 
class  transform_view
 A transforming iterator adaptor. More...
 
class  trie
 An implementation of a trie. Semantically, this corresponds to a function \(K^* \to V\). More...
 
struct  type_id
 A runtime type identifier that does not require RTTI. More...
 
struct  type_identity
 An implementation of std::type_identity. More...
 
class  view_interface
 An implementation of std::ranges::view_interface. More...
 

Typedefs

using atom = lib::variant<lib::symbol, lib::number>
 An atom is either a symbol or a number.
 
template<typename T >
using effect_result_t = lib::invoke_result_t<decltype(lib::fallback), const T &>
 Evaluates to the result type of the given effect.
 
template<typename F , typename... Args>
using invoke_result_t = decltype(lib::invoke(std::declval<F>(), std::declval<Args>()...))
 An implementation of std::invoke_result_t.
 
template<typename I >
using iter_value_t = typename std::iterator_traits<I>::value_type
 The type of value pointed to by an iterator.
 
template<typename I >
using iter_reference_t = typename std::iterator_traits<I>::reference
 The return type of operator* for an iterator.
 
template<typename I >
using iter_difference_t = typename std::iterator_traits<I>::difference_type
 The return type of operator- for an iterator.
 
template<typename I >
using iter_category_t = typename std::iterator_traits<I>::iterator_category
 A tag type indicating the level of supported iterator options a type provides.
 
template<typename I >
using iota_diff_t = typename iota_diff<I>::type
 Computes a type large enough to contain the difference between two instances of an iterator.
 
template<typename T >
using iterator_t = decltype(lib::begin(std::declval<T &>()))
 Obtains the iterator type of a range type.
 
template<typename T >
using view = lib::void_t<lib::range<T>, lib::movable<T>, lib::enable_if_t<lib::enable_view<T>{}>>
 
template<typename R >
using range_size_t = decltype(lib::size(std::declval<R &>()))
 The type of value returned by lib::size.
 
template<typename R >
using range_difference_t = lib::iter_difference_t<lib::iterator_t<R>>
 The type of value returned by operator- for a range type's iterators.
 
template<typename R >
using range_value_t = lib::iter_value_t<lib::iterator_t<R>>
 The type of element contained in a range.
 
template<typename R >
using range_reference_t = lib::iter_reference_t<lib::iterator_t<R>>
 The type returned by operator* for a range type's iterators.
 
template<typename... >
using void_t = void
 An implementation of std::void_t.
 
template<bool Cond, typename T , typename F >
using conditional_t = typename std::conditional<Cond, T, F>::type
 An implementation of std::conditional_t.
 
template<bool Cond, typename T = void>
using enable_if_t = typename std::enable_if<Cond, T>::type
 An implementation of std::enable_if_t.
 
template<typename T >
using decay_t = typename std::decay<T>::type
 An implementation of std::decay_t.
 
template<typename T >
using remove_cv_t = typename std::remove_cv<T>::type
 An implementation of std::remove_cv_t.
 
template<typename T >
using remove_extent_t = typename std::remove_extent<T>::type
 An implementation of std::remove_extent_t.
 
template<typename T >
using make_unsigned_t = typename std::make_unsigned<T>::type
 An implementation of std::make_unsigned_t.
 
template<typename... Args>
using common_type_t = typename std::common_type<Args...>::type
 An implementation of std::common_type_t.
 
template<typename T >
using remove_cvref_t = typename std::remove_cv<typename std::remove_reference<T>::type>::type
 An implementation of std::remove_cvref_t.
 
template<typename T , typename... >
using type_identity_t = T
 An implementation of std::type_identity_t.
 
template<std::size_t I, typename T >
using tuple_element_t = typename std::tuple_element<I, T>::type
 Provides compile-time access the the types of the elements of a tuple.
 
template<typename T >
using remove_reference_t = typename std::remove_reference<T>::type
 An implementation of std::remove_reference_t.
 
template<typename T >
using remove_const_t = typename std::remove_const<T>::type
 An implementation of std::remove_const_t.
 
template<typename T >
using make_signed_t = typename std::make_signed<T>::type
 An implementation of std::make_signed_t.
 
template<typename T >
using add_lvalue_reference_t = typename std::add_lvalue_reference<T>::type
 An implementation of std::add_lvalue_reference_t.
 
template<typename T >
using add_rvalue_reference_t = typename std::add_rvalue_reference<T>::type
 An implementation of std::add_rvalue_reference_t.
 
template<typename T >
using add_const_t = typename std::add_const<T>::type
 An implementation of std::add_const_t.
 
template<typename T >
using add_pointer_t = typename std::add_pointer<T>::type
 An implementation of std::add_pointer_t.
 
template<typename T >
using remove_pointer_t = typename std::remove_pointer<T>::type
 An implementation of std::remove_pointer_t.
 
template<std::size_t... Ints>
using index_sequence = integer_sequence<std::size_t, Ints...>
 An implementation of std::index_sequence.
 
template<std::size_t N>
using make_index_sequence = make_integer_sequence<std::size_t, N>
 An implementation of std::make_index_sequence.
 

Functions

template<typename T >
T * any_cast (any *operand)
 
template<typename T >
const T * any_cast (const any *operand)
 
template<typename T , typename U >
bit_cast (const U &src) noexcept
 Performs a bit-level conversion from one type to another.
 
template<typename R , typename F >
lib::dag< lib::range_value_t< R > > make_dag (R &&range, F func)
 
template<typename F , typename T >
void async (lib::dag< T > &graph, F func)
 Executes a function on each label in a given graph. Calls for unrelated node labels are executed in parallel.
 
template<typename F , typename T >
void async (const lib::dag< T > &graph, F func)
 Executes a function on each label in a given graph. Calls for unrelated node labels are executed in parallel.
 
template<typename F , typename T >
lib::dag< lib::invoke_result_t< F, lib::iterator_t< lib::dag< T > > > > async (lib::dag< T > &graph, F func)
 Executes a function on each label in a given graph and stores the results in a graph with the same structure. Calls for unrelated nodes are executed in parallel.
 
template<typename F , typename T >
lib::dag< lib::invoke_result_t< F, lib::iterator_t< const lib::dag< T > > > > async (const lib::dag< T > &graph, F func)
 Executes a function on each label in a given graph and stores the results in a graph with the same structure. Calls for unrelated nodes are executed in parallel.
 
template<typename T , typename S , typename F >
bool linearize (const lib::dag< T > &dag, S &seed, F func)
 
template<typename T , typename F , typename G >
lib::optional< lib::invoke_result_t< F > > linearize (const lib::dag< T > &dag, F init, G func)
 
lib::effect_result_t< T > fallback (T args)
 Invokes the fallback behaviour for an effect.
 
template<typename... Args>
lib::overload< Args... > make_overload (Args... args)
 Constructs an overloaded functor from a set of pre-existing functors.
 
template<typename V , typename F >
lib::filter_view< V, F > filter (V base, F func)
 
template<typename F >
lib::generate_iterator< F > make_generate_iterator (F func)
 
template<typename I >
lib::subrange< I > make_subrange (I first, I last)
 Constructs a subrange from a pair of iterators.
 
template<typename T , typename... Args>
std::unique_ptr< T > make_unique (Args... args)
 An implementation of std::make_unique.
 
template<typename T >
constexpr T midpoint (T min, T max) noexcept
 An implementation of std::midpoint.
 
template<typename T >
midpoint (T min, T max) noexcept
 An implementation of std::midpoint.
 
template<typename T >
lib::make_unsigned_t< T > to_unsigned (T value)
 Converts an integral value into its equivalent unsigned version.
 
template<typename T >
constexpr lib::optional< lib::decay_t< T > > make_optional (T &&value)
 An implementation of std::make_optional.
 
template<typename T , typename... Args>
constexpr lib::optional< T > make_optional (Args &&...args)
 An implementation of std::make_optional.
 
template<typename T , typename U , typename... Args>
constexpr lib::optional< T > make_optional (const std::initializer_list< U > &ilist, Args &&...args)
 An implementation of std::make_optional.
 
template<typename T , typename U >
bool operator== (const lib::optional< T > &lhs, const lib::optional< U > &rhs)
 An implementation of std::optional::operator==.
 
template<typename T >
bool operator== (const lib::nullopt_t &, const lib::optional< T > &value)
 An implementation of std::optional::operator==.
 
template<typename T >
bool operator== (const lib::optional< T > &value, const lib::nullopt_t &)
 An implementation of std::optional::operator==.
 
template<typename T , typename U >
bool operator== (const U &lhs, const lib::optional< T > &rhs)
 An implementation of std::optional::operator==.
 
template<typename T , typename U >
bool operator== (const lib::optional< T > &lhs, const U &rhs)
 An implementation of std::optional::operator==.
 
template<typename T , typename U >
bool operator!= (const lib::optional< T > &lhs, const lib::optional< U > &rhs)
 An implementation of std::optional::operator==.
 
template<typename T >
bool operator!= (const lib::nullopt_t &, const lib::optional< T > &value)
 An implementation of std::optional::operator==.
 
template<typename T >
bool operator!= (const lib::optional< T > &value, const lib::nullopt_t &)
 An implementation of std::optional::operator==.
 
template<typename T , typename U >
bool operator!= (const U &lhs, const lib::optional< T > &rhs)
 An implementation of std::optional::operator==.
 
template<typename T , typename U >
bool operator!= (const lib::optional< T > &lhs, const U &rhs)
 An implementation of std::optional::operator==.
 
template<typename T , typename U >
bool operator< (const lib::optional< T > &lhs, const lib::optional< U > &rhs)
 An implementation of std::optional::operator<.
 
template<typename T >
bool operator< (const lib::nullopt_t &, const lib::optional< T > &value)
 An implementation of std::optional::operator<.
 
template<typename T >
bool operator< (const lib::optional< T > &, const lib::nullopt_t &)
 An implementation of std::optional::operator<.
 
template<typename T , typename U >
bool operator< (const U &lhs, const lib::optional< T > &rhs)
 An implementation of std::optional::operator<.
 
template<typename T , typename U >
bool operator< (const lib::optional< T > &lhs, const U &rhs)
 An implementation of std::optional::operator<.
 
template<typename T , typename U >
bool operator> (const lib::optional< T > &lhs, const lib::optional< U > &rhs)
 An implementation of std::optional::operator>.
 
template<typename T >
bool operator> (const lib::nullopt_t &, const lib::optional< T > &)
 An implementation of std::optional::operator>.
 
template<typename T >
bool operator> (const lib::optional< T > &value, const lib::nullopt_t &)
 An implementation of std::optional::operator>.
 
template<typename T , typename U >
bool operator> (const U &lhs, const lib::optional< T > &rhs)
 An implementation of std::optional::operator>.
 
template<typename T , typename U >
bool operator> (const lib::optional< T > &lhs, const U &rhs)
 An implementation of std::optional::operator>.
 
template<typename T , typename U >
bool operator<= (const lib::optional< T > &lhs, const lib::optional< U > &rhs)
 An implementation of std::optional::operator<=.
 
template<typename T >
bool operator<= (const lib::nullopt_t &, const lib::optional< T > &)
 An implementation of std::optional::operator<=.
 
template<typename T >
bool operator<= (const lib::optional< T > &value, const lib::nullopt_t &)
 An implementation of std::optional::operator<=.
 
template<typename T , typename U >
bool operator<= (const U &lhs, const lib::optional< T > &rhs)
 An implementation of std::optional::operator<=.
 
template<typename T , typename U >
bool operator<= (const lib::optional< T > &lhs, const U &rhs)
 An implementation of std::optional::operator<=.
 
template<typename T , typename U >
bool operator>= (const lib::optional< T > &lhs, const lib::optional< U > &rhs)
 An implementation of std::optional::operator>=.
 
template<typename T >
bool operator>= (const lib::nullopt_t &, const lib::optional< T > &value)
 An implementation of std::optional::operator>=.
 
template<typename T >
bool operator>= (const lib::optional< T > &, const lib::nullopt_t &)
 An implementation of std::optional::operator>=.
 
template<typename T , typename U >
bool operator>= (const U &lhs, const lib::optional< T > &rhs)
 An implementation of std::optional::operator>=.
 
template<typename T , typename U >
bool operator>= (const lib::optional< T > &lhs, const U &rhs)
 An implementation of std::optional::operator>=.
 
template<typename T >
std::string to_string (const T &value)
 Converts a value to a std::string using operator<<.
 
template<typename T >
lib::optional< T > of_string (const std::string &value)
 Converts a std::string to a value using operator>>.
 
lib::optional< std::stringgetenv (const std::string &name)
 Gets the value of an environment variable.
 
template<typename T >
lib::optional< T > getenv (const std::string &name)
 Gets the value of an environment variable.
 
std::string nameof (const std::type_info &info)
 Gets the demangled name associated with a std::type_info.
 
template<typename T >
std::string nameof ()
 Gets the demangled name associated with a type.
 
template<typename T , typename U = T>
exchange (T &value, U &&next)
 An implementation of std::exchange.
 
template<typename F , typename... Args>
lib::result_holder< lib::invoke_result_t< F, Args... > > make_result_holder (F func, Args &&...args)
 
template<typename F , typename... Args>
lib::result_holder< void > make_result_holder (F func, Args &&...args)
 
template<typename T >
any_cast (const any &operand)
 An implementation of std::any_cast.
 
template<typename T >
any_cast (any &operand)
 An implementation of std::any_cast.
 
template<typename T >
any_cast (any &&operand)
 An implementation of std::any_cast.
 
template<typename T >
const T * any_cast (const any *operand) noexcept
 An implementation of std::any_cast.
 
template<typename T >
T * any_cast (any *operand) noexcept
 An implementation of std::any_cast.
 
template<typename T , typename... Args>
any make_any (Args &&...args)
 An implementation of std::make_any.
 
template<typename F >
lib::finally_t< F > finally (F func)
 

Variables

class { 
 
fallback 
 
struct { 
 
invoke 
 An implementation of std::invoke.
 
struct { 
 
make_filter_iterator 
 Constructs a filter_iterator.
 
struct { 
 
make_index_iterator 
 Constructs an index_iterator.
 
struct { 
 
make_iota_iterator 
 Constructs an iota_iterator.
 
struct { 
 
iota 
 
struct { 
 
begin 
 Gets an iterator to the first element of a range.
 
struct { 
 
end 
 Gets an iterator to past the end of a range.
 
struct { 
 
size 
 Obtains the size of a range.
 
struct { 
 
empty 
 Determines if a range is empty.
 
struct { 
 
ref 
 
struct { 
 
make_transform_iterator 
 Constructs a transform_iterator.
 
struct { 
 
transform 
 Constructs a transform_view.
 
static constexpr nullopt_t nullopt {nullopt_t::tag{}}
 An implementation of std::nullopt.
 
static const lib::ignore_t ignore
 A version of std::ignore usable with initializer lists.
 
static constexpr in_place_t in_place
 An implementation of std::in_place.
 

Detailed Description

General utility library.