[Development] Adding support for version number comparisons

Keith Gardner kreios4004 at gmail.com
Sat May 10 21:47:09 CEST 2014


On Sat, May 10, 2014 at 2:28 PM, Jake Petroules <
jake.petroules at petroules.com> wrote:

> And what about 1.0.0b2? Wouldn't you expect that to be greater than
> 1.0.0b? The problem with trying to implement one comparison algorithm is
> that there are so many different versioning formats in use (at least,
> within the suffix part) that it's nearly impossible to do something that
> works reasonably well for all of them at the same time.
>
> At the absolute least we should have some means to use a custom suffix
> comparison (compare() overload that takes a function as a parameter?).
>

Correct me if I am wrong but it sounds like there needs to be some
additional information to perform the compare.  It looks like the suffix
needs to be labeled as pre-release or release for each version.  Instead of
putting that into the compare, it could be a member variable for the
QVersion.  This would allow for "1.0.0b2" to compare properly with
"1.0.0beta" without providing extra flags and the label will follow the
instance of QVersion.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140510/9694f7b4/attachment.html>


More information about the Development mailing list