A C++17 base library
A collection of useful meta helpers and value types.
The goal is to write ISO Standard conforming C++17. Everything that does not conform to the standard is a bug.
Additionally the code has to compile at least at the latest stable releases of:
- Visual Studio C++
GCC has long standing compiler bugs that allow no workarounds, therefore it is not a goal.
Workarounds for specific compiler bugs should be marked as such! It is a bug if a workaround is no longer required and not removed.
C++ uses a unified namespace between types, functions and constants. Therefore we use the following patterns.
lower_casingfor constexpr constants & namespaces
clang-format is used with the
cpp17- configures the compilers
meta17- everything without runtime code or data
tuple17- simple & fast replacement for
strong17- simple opinionated strong typedefs
one_of17- simple & fast relacement for
some_of17- a heap allocated & packed
The main goal is to allow simple and efficient compile time introspections.
The library itself should stay simple and readable. All functions and constants are constexpr. All functions arguments have enforced zero size.
- build the type wrapper from the elements
- ensure no double encoding
- get the wrapped value
- also works if value was never wrapped
- get elements of a wrapper and wrap them differently
- will never work with unwrapped values
- helper to build recursive functions
- keeps the same type of wrapper
- produces the wrapped value
- involves some compile time computations
- appropriate compare & arithmetic operations
- checks if a given type is that kind of wrapper
- random access to wrapped elemets of a pack wrapper
Fold & indexOf
- folding / search algorithms for pack wrappers
- empty constexpr wrapper for any type
- support for compile time comparison
- operations on any template of types
- operations on any template of values
- Any amount of types
- Support for concatentation, indexOf & recursion
- std::integral_constant but with C++17 auto
- empty struct (use functons)
- required special const, because Const == Const<0>
- convinient implicit cast to bool allows usage in if constexpr conditions
- specialisation of Const for size_t
- implements arithmetic operators
- Any amount of values
- Support for concatentation, folding & recursion
- specialisation of ConstPack for size_t
- conversions for std::index_sequence
- wrapper that associates an index to a type
- TypePack of IndexTypes
- allows for enum like index generation
- constexpr wrapper struct for IndexTypePacks
- ensures all indices are unique
- a lot of member functions
This project usses the MIT License - see LICENSE file.
Please report your ideas and bugs as issues! Pull requests are also welcome.