This library implements the Semantic Versioning specification in C++, allowing you to easily compare software versions.
Use semverpp as a Re dependency by adding the following to your re.yml
:
deps:
# <...>
- github:osdeverr/semverpp@v1.0.0 [semverpp]
Additionally, you can install it as a global package by running re pkg install github:osdeverr/semverpp@v1.0.0 as semverpp
and later use it by adding it as a dependency like that:
deps:
# <...>
- global:semverpp [semverpp]
#include <semverpp/version.hpp>
/* <...> */
semverpp::version version{"1.2.3"};
// or semverpp::version version{1, 2, 3}
assert(version > semverpp::version{"1.2"} && version < semverpp::version{"1.3"});
assert(version == semverpp::version{"1.2.3+some.build.metadata"});
assert(semverpp::version{"1.2.3-beta"} > semverpp::version{"1.2.3-alpha"});