Neargye / semver

Semantic Versioning for modern C++
MIT License
294 stars 32 forks source link

[Feature Request] Support for Semver Ranges #6

Open Gei0r opened 4 years ago

Gei0r commented 4 years ago

Hey, could you add support for ranges to the library? These are not in the official standard, but are still widely used.

Example: ^1.2.3 means >= 1.2.3 && < 2.0.0

So maybe add a class semver::range with:

Here's the node documentation for semver ranges. This github project also has test cases.

Neargye commented 4 years ago

Hi, yes, it looks useful, I will add semver::range

Neargye commented 4 years ago

You want ranges and advanced-range-syntax?

Gei0r commented 4 years ago

Yeah, both would be awesome 😎

egorpugin commented 3 years ago

@Gei0r You might be interested in my version with advanced ranges etc. See tons of examples in tests https://github.com/egorpugin/primitives/blob/master/src/version.cpp#L1839 Root dir https://github.com/egorpugin/primitives/tree/master/src/version

It works in my C++ build system/package manager and you need it to include into your project, again, if you're interested. https://software-network.org/

icnocop commented 3 months ago

When comparing X-Ranges, the code currently hangs.

semver::version l_v("1.0.0");
std::string_view r_v("2.x");

semver::range::satisfies(l_v, r_v);