|
dot-xx
A personal collection of small C++ modules
|
The main namespace of the dxx::utils module. More...
Namespaces | |
| namespace | heap |
| The namespace for heap-allocated replacements for some standard library classes. | |
Classes | |
| struct | As |
| class | Defer |
| Class for deferring operations until the end of lifetime. More... | |
| class | FileDescriptor |
| RAII file descriptor. Wraps an integer file descriptor and defers closing it to the desctructor. More... | |
Concepts | |
| concept | pointer |
| Concept over std::is_pointer_v. | |
| concept | reference |
| Concept over std::is_reference_v. | |
| concept | const_vrp |
| A const value, a pointer to const, or a reference to const. | |
| concept | mut_vrp |
| Inverse of const_vrp. | |
| concept | is_a |
| Checks if the type is an instance of a template. | |
| concept | either_of |
| Checks if a type is the same as at least one of the provided arguments. | |
| concept | neither_of |
| Checks if a type is neither of provided arguments. | |
| concept | declares |
| Checks if the type was used to declare a certain value. | |
Functions | |
| template<typename Integer> | |
| constexpr auto | range (const Integer &to) |
| Python-like range function ([ 0, to )). | |
| template<typename From, std::convertible_to< From > To> | |
| constexpr auto | range (const From &from, const To &to) |
| Python-like range function ([ from, to )). | |
| template<typename From, std::convertible_to< From > To, std::convertible_to< From > Step> | |
| constexpr auto | range (const From &from, const To &to, const Step &step) |
| Python-like range function ([ from, to ) with step step). | |
Variables | |
| template<typename T, typename... Ts> | |
| constexpr std::optional< std::size_t > | find_type_in = FindTypeIn<0, T, Ts...>::value |
Find the type T in the list of types Ts, return its index if present, otherwise is std::nullopt. | |
| template<template< typename... > typename Range> | |
| constexpr As< Range > | as {} |
| An adaptor-like shortcut to invoking an std::from_range constructor for a class template. | |
The main namespace of the dxx::utils module.
|
inlinenodiscardconstexprexport |
Python-like range function ([ from, to )).
|
inlinenodiscardconstexprexport |
Python-like range function ([ from, to ) with step step).
|
inlinenodiscardconstexprexport |
Python-like range function ([ 0, to )).
|
inlineconstexprexport |
An adaptor-like shortcut to invoking an std::from_range constructor for a class template.
Does not work with regular types - use std::ranges::to or the constructor directly
E.g
is the same as
or