tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: g++/map vs. clang



On Thu, Apr 12, 2012 at 12:35:00AM +0200, Thomas Klausner wrote:
> On Tue, Apr 10, 2012 at 11:39:26AM -0400, Christos Zoulas wrote:
> > Sure, but also add a comment saying that clang breaks with it, but the
> > code might not be at fault.
> 
> Well, Dennis Ferguson <dennis.c.ferguson%gmail.com@localhost> posted the link
>       http://clang.llvm.org/compatibility.html#deleted-special-func
> which to me seems to point out just a standards issue.
> 
> I'll take a look if I can make copy constructors based on Jörg's link.

I took a look, but my C++ foo is not good enough to make whatever copy
constructor clang wants here.

I claim that compilable code is preferable to probably faster
non-compilable code, and that it can be made faster by introducing
well-constructed copy&move constructors later on, so I'd like to go
ahead with committing the attached diff (haven't changed it since my
previous mail).

Ok?
 Thomas
--- usr/include/g++/bits/stl_pair.h     2012-04-08 18:43:34.000000000 +0200
+++ /home/wiz/stl_pair.h        2012-04-10 14:07:18.000000000 +0200
@@ -121,6 +121,7 @@
        : first(std::forward<_U1>(__p.first)),
          second(std::forward<_U2>(__p.second)) { }
 
+#ifndef __clang__
       pair&
       operator=(pair&& __p)
       { 
@@ -137,6 +138,7 @@
          second = std::move(__p.second);
          return *this;
        }
+#endif
 
       void
       swap(pair& __p)


Home | Main Index | Thread Index | Old Index