百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

semver

> DevOps
开源

面向现代 C++ 的语义版本管理

356 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

面向现代 C++ 的语义版本管理

Header-only C++17 library for Semantic Versioning 2.0.0. It provides version parsing and validation, comparison, formatting, increments, and a documented range syntax for common version constraints. No dependencies.

cpp
#include 
#include 

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.
  • Mixed-type version comparison and range matching without narrowing.
  • Compact */x/X wildcard, partial, comparator, tilde, caret, whitespace-AND, and || range syntax.
  • 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:

    cmake
    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

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++c-plus-plusc-plus-plus-17cpluspluscplusplus-17

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理