[Development] Qt LTS & C++11 plans (CopperSpice)
Olivier Goffart
olivier at woboq.com
Wed Jul 22 16:47:21 CEST 2015
On Tuesday 21. July 2015 16:03:56 Thiago Macieira wrote:
> On Tuesday 21 July 2015 20:52:05 Giuseppe D'Angelo wrote:
> > Il 21/07/2015 20:37, Thiago Macieira ha scritto:
> > > As opposed to qMapLessThanKey? Do you mean two QMap with the same key
> > > could
> > > have different comparators?
> >
> > Why not?
>
> Not passing judgement. I was only asking for clarification, since that was
> the only feature that Ansel mentioned and, depending on the actual change,
> is not a feature at all since QMap alreaydy supported it.
>
> > Too bad that adding a template parameter to QMap is a huge SiC, as
> > people forward declare it with two template arguments, and we never
> > provided headers for forward declarations... :(
>
> We can fix that with C++11 template aliases.
>
> template <typename Key, typename T>
> using QMap<Key, T> = QMapComparator<Key, T, qMapLessThanKey<Key>>;
This is still source incompatible (because of forward declarations) and binary
incompatible too.
>
> Note however that a function taking QMap<Foo, Bar> is *not* the same as a
> function taking QMapComparator<Foo, Bar, qMapLessThanKey<Foo>>. The two
> types are not the same, even though they are.
Anyway, If one need to do advanced usages, one could use std::map.
Re-implementing the standard library is not a goal of Qt.
More information about the Development
mailing list