Components
Most of the components are under the main include directory clu. Some of the core headers (like type_traits.h) are used by other ones, while most of the other headers aren’t depended upon. Things under clu/experimental are highly unstable, some of them may not even compile.
A list of all the headers and their contents is presented as follows:
- Header any_unique.h
Provides a type-erasure class to store objects of unknown types.
assertion.hDefines a macro
CLU_ASSERT(expr, msg), which functions roughly the same asassertfrom<cassert>, but takes an additional message parameter.buffer.hA buffer class template, similar to
std::spanbut more suitable for raw buffer manipulation.- Header c_str_view.h
View types for null-terminated strings.
chrono_utils.hUtilities related to
std::chrono. Providing a centralized namespace for all the constants instd::chronolikestd::chrono::January. Also some helper functions.concepts.hUseful concepts for meta-programming.
expected.hA sum type storing a value or an error
Ok | Err, likeResultin Rust. A rough implementation of P0323R10:std::expected.- Header file.h
Contains a function
read_all_bytesthat reads all contents of a binary file into astd::vector.fixed_string.hA fixed string class that can be used as class non-type template parameters.
flags.hA wrapper for flag enumeration types.
forest.hAn STL-styled hierarchical container type.
function_ref.hNon-owning type-erasure types for invocables.
function_traits.hType traits for function types. Provides meta-functions for extracting parameter types or result type from function signatures.
- Header hash.h
Hash-related utilities. Provides
constexprimplementations of FNV-1a and SHA1 hash functions, and ahash_combinefunction.indices.hA random-access range for multi-dimensional indexing, so that you could use
for (const auto [i, j, k] : indices(3, 4, 5))instead of nestedforloops.integer_literals.hUDLs for fixed-length integral literals, like
255_u16.iterator.hAdapter class template for iterators. Provides default implementations for the iterator concepts.
manual_lifetime.hHelper class for manually controlling lifetime of an object.
meta_algorithm.hAlgorithms for type lists.
meta_list.hType lists and value lists for meta-programming.
new.hHelpers for aligned heap allocation.
oneway_task.hA fire-and-forget coroutine type which starts eagerly.
optional_ref.hstd::optionallike interface for optional references.overload.hOverload set type. Useful for
std::visit.scope.hScope guards for running arbitrary code at destruction. Useful for ad-hoc RAII constructs.
static_for.hLoop over compile time indices. Can also be used as a way to force loop unrolling.
static_vector.hstd::vectorlike container allocated on the stack, with a fixed capacity.string_utils.hString-related utilities.
type_traits.hUseful type traits for meta-programming.
piper.h“Pipeable” wrappers for invocables, like those ranges adapters.
polymorphic_value.hA smart pointer type for copyable polymorphic types. A rough implementation of P0201R3: A polymorphic value-type for C++.
polymorphic_visit.hstd::visit, but for polymorphic types.unique_coroutine_handle.hAn RAII type for
std::coroutine_handle<T>which destroys the handle on destruction.vector_utils.hA
make_vectorfunction to remedy the fact that we cannot usestd::initializer_listto initialize containers with move-only elements.