Re: Are clang++ and libc++ compatible?

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Tue, 12 Nov 2013 22:46:38 +0100
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


Received on Tue Nov 12 2013 - 20:46:46 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:44 UTC