carb::isVersionSemanticallyCompatible
Defined in carb/Version.h
-
inline bool carb::isVersionSemanticallyCompatible(const char *name, const Version &minimum, const Version &candidate)
Checks two versions to see if they are semantically compatible.
For more information on semantic versioning, see https://semver.org/.
Warning
A major version of
0
is considered to be the “development/experimental” version and0.x
minor versions may be but are not required to be compatible with each other. This function will considerminimum
version0.x
to be semantically compatible to differentcandidate
version0.y
, but will emit a warning tostderr
if aname
is provided.- Parameters
name – An optional name that, if provided, will enable the warning message to
stderr
for0.x
versions mentioned above.minimum – The minimum version required. This is typically the version being tested.
candidate – The version offered. This is typically the version being tested against.
- Return values
true – If
minimum
andcandidate
share the same major version andcandidate
has a minor version that is greater-than or equal to the minor version inminimum
.false – If
minimum
andcandidate
have different major versions orcandidate
has a minor version that is lower than the minor version requested inminimum
.