[Development] Adding support for version number comparisons
jake.petroules at petroules.com
Wed May 14 22:35:24 CEST 2014
On 2014-05-14, at 04:26 PM, Thiago Macieira <thiago.macieira at intel.com> wrote:
> Em qua 14 maio 2014, às 08:45:28, Keith Gardner escreveu:
>>> Well, if you use a virtual, you'd simply subclass to handle the specific
>>> format for your project.
>> I haven't thought about using inheritance to simplify the compare but I
>> think that would provide the best compromise.
> I don't want virtuals in this class.
> I could accept a comparator function (e.g., a lambda), but I still think
> that's overkill.
> QVersion could simply report how many tokens it could parse and then leave it
> up to the upper layer to deal with the rest of the string.
> Thiago Macieira - thiago.macieira (AT) intel.com
> Software Architect - Intel Open Source Technology Center
> Development mailing list
> Development at qt-project.org
I think the fact that this email thread is already 40 messages long clearly illustrates the need for custom comparators. Let's use a lambda as an optional argument to compare().
We could even export a few default comparator functions from QtCore if deemed necessary.
Jake Petroules - jake.petroules at petroules.com
Chief Technology Officer - Petroules Corporation
More information about the Development