Are clang++ and libc++ compatible?

Dimitry Andric dim at FreeBSD.org
Tue Nov 12 21:46:46 UTC 2013


On 12 Nov 2013, at 22:19, Tijl Coosemans <tijl at coosemans.org> wrote:
...
There's a similar problem with graphics/blender.  There's a class
> TreeElement which links to its parent TreeElement like this:
> 
> std::map<std::string, TreeElement>::const_iterator parent;
> 
> Works with libstdc++, fails with libc++.  If the standard doesn't
> specify this it would still be a very convenient extension.

The standard explicitly says this is undefined, except for a few
specific (non-container) classes in C++11.  So to write portable code,
you should not rely on this "feature" to be available.

Besides, it is relatively easy to work around.  Except for the case of
pan, where it is abused all over the place, and it seems tricky to fix
without overhauling a lot of code... :-/

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20131112/3e483e0e/attachment-0001.sig>


More information about the freebsd-current mailing list