[Development] QtCS: Notes from Modern C++ session

Olivier Goffart olivier at woboq.com
Fri Jun 12 12:12:17 CEST 2015


On Friday 12. June 2015 10:17:21 Marc Mutz wrote:
> Hi Andre,
> 
> thanks for the write-up!
> 
> On Friday 12 June 2015 08:08:51 André Somers wrote:
> > Available for use then:
> range-for?
> variadic macros (these we already use in tests/ and no-one complained so
> far).
> > No for now: std::for_each (issues with leaks)
> 
> Which leaks?

Good question!

I think the discussion was more about the ranged-based for. 
We cannot recommend to use it with Qt containers because it detaches. But 
otherwise it may still be good it we want to modify the container in-place.

> > For now, don’t put std lib ABI into Qt ABI, except for nulltpr_t.
> 
> Too late: QException inherits std::exception (for a looong time already),

That's a good point, I had not realized that.

However: inheriting do not make the name part of the mangling. And QException 
is almost not used (esp if compiled with -fno-exception)


> and by virtue of various exported subclasses of QVector and QList, we
> export ABI that contains std::vector and std::list (toStdList(),
> toStdVector()). We probably also export ABI using std::string, because I'm
> sure someone somewhere has inherited an exported class from QString...

Those method are inline and therefore do not count (because the only impacted 
compiler is MSVC which is not binary compatible with itself between releases)


Anyway, in light of this QException breakage, maybe we should consider using 
the standard library in our ABI.
Which mean using things like std::function, std::unique_ptr, in our ABI.
Should we allow that?



We also did not had the time to come to the smart pointer discussion.

-- 
Olivier 

Woboq - Qt services and support - http://woboq.com - http://code.woboq.org




More information about the Development mailing list