Panda-Lib
Panda-Lib is a C++ library with basic functionality. It contains implementation of string, function, pool allocator, error handling and a some others. It is not yet another std implementation. Some classes are similar to std ones, i.e. panda::string is effective replacement of std::string.
Build and Install
Panda-Lib is suppose to be built with CMake.
mkdir build
cd build
cmake ..
cmake --build .
cmake --build . --target install
Dependencies
Lib itself does not depend on anything but it use Catch2 for tests. By default tests are disabled. Set PANDALIB_TESTS=ON to build tests and make sure that find_package can find Catch2.
Documentation
All documentation is in doc folder.
Main features
- panda::string - optimized std compatible string with CoW and SSO
- Error Handling - error types overview and usefull tools such as expected and backtrace
- CallbackDispatcher - implementation of Event Listener pattern based on custom implementation of function type
- Logger - simple API for logs with lazy evaluation and flexible management
- memory - fast allocators and helpers
- iptr - smart pointer based on intrusive reference counter
Tools and helperes
- dyn_cast - Caching wrapper of
dynamic_cast. It stores a static cache by types andtype_idto make dynamic_cast faster - endian.h - endian conversions for all integer types
- hash.h - hash algorithms (hash_murmur64a, hash_jenkins_one_at_a_time)
- make_iterator_pair - make range from iterator pair
- owning_list - linked list that guaraties iterator validity in any case of deletion or insertion. Importatnt part of CallbackDispatcher implementation
- Macro Overload - preprocessor macro overloading by number of arguments
- String Containers - map/set, unordered_map/unordered_set by string that alowed look up with string_view without creation of a string object.
- traits.h - some type traits for meta programming.
- VarIntStack - stack of integerss stored as compact as possible using variadic int compression. Does not allocate untill container is less than 22 bytes (x64).
Old C++ standard support
- optional.h - implementation of the latest C++20 optional API for C++14.
- from_chars.h -
from_charsandto_charsfunctions for C++14. - string_view.h -
string_viewfor C++14.