Tenno is a library inspired by the C++23 standard library, compatible with C++17 language onwards. It aims to provide constexpr and thread-safe containers with security in mind. You can expect most of the apis to be similar to the standard library.
- exceptions are NEVER thrown, instead values are returned as
optional
orexpected
- constexpr functions and data structures
- thread-safe data structures
- modern-looking and readable c++ code
- performance
The library officially supports all GCC compilers starting from gcc-8.5.0. Constexpr functions are guaranteed to work from c++20 onward.
The library aims to provide thread safe / constexpr containers and algorithms that are not provided by the standard library, currently the library provides the following features:
- tenno::array<T,N>
- tenno::expected<T,E>
- tenno::range<T>
- tenno::error
- tenno::atomic<T>
- tenno::mutex
- tenno::lock_guard<T>
- tenno::optional<T>
- tenno::shared_ptr<T>
- tenno::copy<It1,It2,F>
- tenno::for_each<It1,It2,F>
- tenno::accumulate<It1,It2,T>
- tenno::swap<T>
- tenno::move<T>
- tenno::make_shared<T, Deleter, Alloc>
- tenno::allocate_shared<T, Alloc>
- tenno::unique_ptr<T>
- tenno::make_unique<\T>
- tenno::jthread
- tenno::weak_ptr<T>
- tenno::allocator<T>
- tenno::default_delete<T>
- tenno::vector<T>
- tenno::reference_wrapper
- tenno::uniform_real_distribution
- tenno::deque: TODO
- tenno::stack: TODO
- tenno::map: TODO
- tenno::unordered_map: TODO
- tenno::mdspan: TODO
- tenno::thread pool: TODO
bazel build //:libtenno
Build as a library:
cmake -Bbuild -DTENNO_BUILD_SHARED=ON -DTENNO_BUILD_OPTIMIZED=ON
Note that tests are enabled by default.
meson setup build
ninja -C build
./build/tests --help
The library uses valFuzz for testing
./build/tests # run tests
./build/tests --fuzz # run fuzzer
./build/tests --benchmark # run benchmarks
The library uses doxygen for documentation, to build the html documentation run:
make docs
tenno implements compile-time random number generation through
the uniform_real_distribution()
and the random_array()
dunctions,
enabling you to use random numbers in constexpr algorithms.
tenno::array<T,N>.at(n)
returns expected<T,E>
with either the value
or a tenno::error
with the error out_of_range
if the range specified
is bigger than the size of the array.
tenno::vector<T>.at(n)
returnsexpected<T,E>
tenno::vector<T>.front()
returnexpected<const T&,E>
tenno::vector<T>.back()
returnsexpected<const T&,E>
tenno::vector<T>.operator[]
returnsexpected<T,E>
- all iterator access methods return
expected<T,E>
- iterator is divided into
iterator
anditerator_mut
std::reference_wrapper\<T>.get()
has beed renamed tostd::reference_wrapper\<T>.ref()