GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Neargye/semver: Semantic Versioning for modern C++

BranchesTags
Open more actions menu

Latest commit

 

History

229 Commits
229 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
doc
doc
 
 
example
example
 
 
include
include
 
 
test
test
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

GitHub releases vcpkg package Conan package License

Header-only C++17 library for Semantic Versioning 2.0.0. Parse, validate, compare, format, and increment versions, or match them against version ranges. No dependencies.

#include <cassert>
#include <semver.hpp>

int main() {
  const auto version = semver::from_string("1.2.3");
  assert(version.major() == 1);

  const auto range = semver::try_parse_range("^1.2");
  if (!range)
    return 1;

  assert(range->contains(version));
}

Features

  • SemVer 2.0.0 parsing and validation with configurable input limits.
  • Configurable unsigned component types; version<> uses std::uint32_t.
  • Compare versions and match ranges across different component types.
  • Wildcard, partial, comparator, tilde (~), and caret (^) ranges. Combine constraints with spaces (AND) or || (OR).
  • Range matching, intersection checks, and minimum-version queries.
  • from_chars/to_chars, streams, std::hash, and optional std::format support.
  • Compile-time parsing where the compiler and standard library support it.

See the API reference and limitations.

Integration

Copy semver.hpp, or use a package manager:

  • vcpkg: neargye-semver

  • Conan: neargye-semver/x.y.z

  • CPM: CPMAddPackage(GITHUB_REPOSITORY Neargye/semver GIT_TAG x.y.z)

  • CMake package:

    find_package(semver CONFIG REQUIRED)
    target_link_libraries(your_target PRIVATE semver::semver)

More examples are available in example/.

Compiler compatibility

semver requires C++17 or newer and supports:

  • Clang/LLVM >= 6
  • Apple Clang >= 10
  • GCC >= 7
  • Visual Studio >= 2019

MIT License

About

Semantic Versioning for modern C++

Topics

c-plus-plusc-plus-plus-17cpluspluscplusplus-17cppcpp17header-onlyno-dependenciessemantic-versioningsemversingle-file

Resources

Readme
MIT license
Activity

Stars

359 stars

Watchers

8 watching

Forks

47 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.