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 and 0.x minor versions may be but are not required to be compatible with each other. This function will consider minimum version 0.x to be semantically compatible to different candidate version 0.y, but will emit a warning to stderr if a name is provided.

Parameters
  • name – An optional name that, if provided, will enable the warning message to stderr for 0.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 and candidate share the same major version and candidate has a minor version that is greater-than or equal to the minor version in minimum.

  • false – If minimum and candidate have different major versions or candidate has a minor version that is lower than the minor version requested in minimum.