Home

Awesome

sfl library

This is header-only C++11 library that offers several new or less-known containers:

Features

Requirements

This library requires C++11 compiler or newer. If available, library uses features of newer C++ standards.

Tested compilers:

Installation and usage

Method 1: Manual copy-paste

Step 1: Copy sfl subdirectory from include into your project directory.

Step 2: Configure your project or compiler to search include files in sfl subdirectory.

Step 3: #include what you need.

Method 2: CMake integration

This library can be integrated into CMake project using CMake module FetchContent.

Step 1: Add the following lines into your CMakeLists.txt:

include(FetchContent)

FetchContent_Declare(
    sfl
    GIT_REPOSITORY https://github.com/slavenf/sfl-library)

FetchContent_MakeAvailable(sfl)

Step 2: Add this library as a dependency into your CMakeLists.txt::

target_link_libraries(your_target_name PRIVATE sfl)

Step 3: #include what you need.

Exceptions

This library by default throw exceptions in case of error.

If macro SFL_NO_EXCEPTIONS is defined then library avoids using exceptions and calls std::abort in case of error.

This library does not automatically detect whether the compiler is invoked with appropriate flag or not, like -fno-exceptions in GCC and Clang.

Debugging

This library extensively uses macro assert from header <cassert>.

The definition of the macro assert depends on another macro, NDEBUG, which is not defined by the standard library.

If macro NDEBUG is defined then assert does nothing.

If macro NDEBUG is not defined then assert performs check. If check fails, assert outputs implementation-specific diagnostic information on the standard error output and calls std::abort.

Detailed documentation

The detailed documentation is located in directory doc. The detailed documentation is handwritten in Markdown format, it is not automatically generated with tools like Doxygen, so there may be some errors or mistakes. If you find one, please report it.

Tests

Test programs and scripts are located in directory test.

Tested compilers are listed in section Requirements.

Each test program is checked with Valgrind tool.

License

Licensed under zlib license. The license text is in file LICENSE.txt.