tech-toolchain archive

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

Re: g++/map vs. clang



Hi Jörg!

On Tue, Apr 10, 2012 at 01:18:34PM +0200, Joerg Sonnenberger wrote:
> On Tue, Apr 10, 2012 at 12:39:04PM +0200, Thomas Klausner wrote:
> > On Mon, Apr 09, 2012 at 11:57:57PM +0000, Christos Zoulas wrote:
> > > I think it is better to ifndef __clang__ or whatever than #if 0 it.
> > 
> > Good point. The attached diff works as well. Ok to commit?
> 
> Removing the copy constructor is IMO *not* acceptable.

You're right, it's sufficient to just remove the move stuff:
#ifndef __clang__
      pair&
      operator=(pair&& __p)
      { 
        first = std::move(__p.first);
        second = std::move(__p.second);
        return *this;
      }

      template<class _U1, class _U2>
        pair&
        operator=(pair<_U1, _U2>&& __p)
        {
          first = std::move(__p.first);
          second = std::move(__p.second);
          return *this;
        }
#endif

(diff attached)
 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