Skip to content
/ tenno-tl Public

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.

License

Notifications You must be signed in to change notification settings

San7o/tenno-tl

Repository files navigation

tenno template library

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.

Design goals

  • exceptions are NEVER thrown, instead values are returned as optional or expected
  • 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.

Currently implemented

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:

Building

Using bazel

bazel build //:libtenno

Using Cmake

Build as a library:

cmake -Bbuild -DTENNO_BUILD_SHARED=ON -DTENNO_BUILD_OPTIMIZED=ON

Note that tests are enabled by default.

Using meson

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

Documentation

The library uses doxygen for documentation, to build the html documentation run:

make docs

Differences with STL

random

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.

array

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.

vector

  • tenno::vector<T>.at(n) returns expected<T,E>
  • tenno::vector<T>.front() return expected<const T&,E>
  • tenno::vector<T>.back() returns expected<const T&,E>
  • tenno::vector<T>.operator[] returns expected<T,E>
  • all iterator access methods return expected<T,E>
  • iterator is divided into iterator and iterator_mut

functional

  • std::reference_wrapper\<T>.get() has beed renamed to std::reference_wrapper\<T>.ref()

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published