The versatile C++23 utility library
Reusable, well-tested building blocks for any modern C++ project.
Examples
ยท
Changelog
ยท
Report a Bug
NVTools is a versatile C++23 utility library.
Born from the need to stop rewriting the same boilerplate code across different applications, NVTools provides a reusable set of C++ utilities designed to make everyday development faster, safer, and more efficient. Every module is unit-tested, built without warnings and checked with sanitizers, and the library works as a static or a shared library.
Include <NVTools/NVTools.hpp> for everything, or only the header of a module, such as <NVTools/String/String.hpp>.
| Module | Namespace | Highlights |
|---|---|---|
| ๐ค String | NVTools::String |
Join strings and numbers with a separator |
| ๐ท๏ธ Version | NVTools |
Version of the headers and of the binary, build description |
| ๐งฉ More | Coming soon |
Requirements: a C++23 compiler (GCC 14+; Clang and MSVC are not tested yet) and CMake 3.28+.
Add NVTools to your CMakeLists.txt with FetchContent:
include(FetchContent)
FetchContent_Declare(NVTools
GIT_REPOSITORY https://github.com/NetcatRunner/NVTools.git
GIT_TAG main # or a release tag, such as v0.1.0
)
FetchContent_MakeAvailable(NVTools)
target_link_libraries(my_app PRIVATE NVTools::NVTools)
Or install it and use find_package:
cmake --workflow --preset release
cmake --install build/release --prefix /path/to/install
find_package(NVTools CONFIG REQUIRED) # with -DCMAKE_PREFIX_PATH=/path/to/install
target_link_libraries(my_app PRIVATE NVTools::NVTools)
| CMake option | Default | Description |
|---|---|---|
BUILD_SHARED_LIBS |
OFF |
Build NVTools as a shared library |
NVTOOLS_BUILD_TESTS |
ON for the main project |
Build the unit tests (requires GoogleTest, through vcpkg) |
NVTOOLS_BUILD_EXAMPLES |
ON for the main project |
Build the examples |
NVTOOLS_INSTALL |
ON for the main project |
Generate the install rules and the CMake package |
NVTOOLS_WERROR |
OFF (ON in the presets) |
Treat warnings as errors |
Here is a quick glimpse of how easy it is to use NVTools in your main application:
#include <NVTools/NVTools.hpp>
#include <print>
#include <string>
#include <vector>
int main() {
std::println("{}", NVTools::buildDescription()); // NVTools 0.0.0 (GCC, Release)
const std::vector<std::string> words = {"alpha", "beta", "gamma"};
std::println("{}", NVTools::String::join(words, ", ")); // alpha, beta, gamma
std::println("{}", NVTools::String::join({1, 2, 3}, " + ")); // 1 + 2 + 3
}
More in the examples.
NVTools is a community-driven library. Whether you want to fix a bug, add a function, add a module or fix a typo, your help is welcome: see CONTRIBUTING.md to get started, and CHANGELOG.md for what changed in each release. To report a security problem, follow SECURITY.md.
Distributed under the MIT License. See LICENSE for more information.