Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #15227

Re: Default move constructor/assignment

From Miles Bader <miles@gnu.org>
Newsgroups comp.lang.c++
Subject Re: Default move constructor/assignment
Date 2012-04-05 16:48 +0900
Message-ID <87k41uy5yk.fsf@catnip.gol.com> (permalink)
References <4f7c129b$0$4386$7b1e8fa0@news.nbl.fi> <4f7d3aa0$0$3114$7b1e8fa0@news.nbl.fi>

Show all headers | View raw


Juha Nieminen <nospam@thanks.invalid> writes:
>>  I can't find any info about this with google.
>
>   Seemingly I have encountered such cutting-edge C++11 technology
> that nobody even here seems to know the answers... :)

FWIW, my memory is that the compiler should make default move
constructors _but_ will avoid doing so if you define _any_ explicit
move _or_ copy constructors (and similarly, an explicit move
constructor will suppress default copy constructors).

[I believe the "suppresses everything" behavior was a lateish change
in the standard, and caused some problems compiling libstdc++ with
clang at some point when clang had been updated to reflect the change,
but libstdc++ had not... but my impression is that both gcc and clang
are both up-to-date now in their latest releases.]

But that's just my vague memory, and I have no links or tests at hand
to back it up, so take it with a large grain of salt ...

-miles

-- 
Happiness, n. An agreeable sensation arising from contemplating the misery of
another.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Default move constructor/assignment Juha Nieminen <nospam@thanks.invalid> - 2012-04-04 09:21 +0000
  Re: Default move constructor/assignment Juha Nieminen <nospam@thanks.invalid> - 2012-04-05 06:24 +0000
    Re: Default move constructor/assignment Miles Bader <miles@gnu.org> - 2012-04-05 16:48 +0900
    Re: Default move constructor/assignment woodbrian77@gmail.com - 2012-04-05 01:26 -0700
      Re: Default move constructor/assignment Juha Nieminen <nospam@thanks.invalid> - 2012-04-05 09:15 +0000
        Re: Default move constructor/assignment woodbrian77@gmail.com - 2012-04-05 09:35 -0700
          Re: Default move constructor/assignment Juha Nieminen <nospam@thanks.invalid> - 2012-04-06 05:29 +0000
            Re: Default move constructor/assignment woodbrian77@gmail.com - 2012-04-06 23:26 -0700
              Re: Default move constructor/assignment Howard Hinnant <howard.hinnant@gmail.com> - 2012-04-07 10:34 -0700
                Re: Default move constructor/assignment woodbrian77@gmail.com - 2012-04-07 15:59 -0700
                Re: Default move constructor/assignment woodbrian77@gmail.com - 2012-04-07 18:58 -0700
                Re: Default move constructor/assignment SG <s.gesemann@gmail.com> - 2012-04-10 02:21 -0700

csiph-web