Lightweight templates for C++ 23.
| Container | Description |
|---|---|
| array | Wrapper around a C array |
| const_map | Const compile time map |
| fixed_map | Fixed size compile time map |
| fixed_set | Fixed size compile time set |
| fixed_string | Fixed size string |
| fixed_vector | Fixed size vector |
| list | Intrusive doubly linked list |
| pair | Basic version of std::pair |
| span | Const view into a contiguous memory space. |
| tuple | Basic version of std::tuple |
| Type | Description |
|---|---|
| defer | Call a callback on scope exit. |
| either | A type that is either one type or another type |
| option | Basic version of std::optional |
| result | Basic version of std::expected |
| Macro | Description |
|---|---|
| DebugType | Type that is only enabled in debug mode. |
| debug_func | Function that is only enabled in debug mode. |
| FOR_EACH | Recursive macro. |
| test | Simple testing framework using recursive macros. |
-
No dynamic memory allocation
-
No exceptions
-
No rtti
-
Almost everything is constexpr
-
The only standard library headers used are:
<new>,<stddef.h>, and<initializer_list>. -
Compiles cleanly with
-Wall -Wextra -Wpedantic -Wshadowand all sanitizers.
In the extras directory there are some other useful utilities that are built using some things from lt.
-
perf.hpp- Usesdeferto profile the current scope using linux perf. You can call the perf_scope("name") macro to profile the current scope or just putperf_funcat the top of any function to profile it. You can then useget_perf_stats()to get a view into everything you've profiled so far with these macros or useprint_perf_stats()to print out all stats rerecorded by perf. Reworked from https://github.com/tezc/sc/tree/master/perf and adapted to C++. -
log.hpp- https://github.com/tezc/sc/tree/master/logger adapted to C++.
The tuple and list were adapted from the Tuple and SelfList from Godot.
Perf and logging utilities were adapted from sc
snprintf from stb