On Saturday, May 26, 2018 at 11:22:58 AM UTC-4, Li Jianhua wrote: > > > From: Ian Lance Taylor <ia...@golang.org <javascript:>> > Sent: Saturday, May 26, 2018 2:56 PM > Subject: Re: [go-nuts] Does Golang need the innovation of C++ move > semantics too > To: Li Jianhua <lin...@outlook.com <javascript:>> > Cc: <golan...@googlegroups.com <javascript:>> > > > On Fri, May 25, 2018 at 8:15 PM, Li Jianhua <lin...@outlook.com > <javascript:>> wrote: > > > > > Why does C++ introduce move semantics anyway? What problems is it going > to > > solve? > > How come Golang, C (Without ++) don’t have that move semantics yet? Will > > they need the move soon? > > > This does not apply to Go at all, because Go has no copy constructors. > In Go copying or moving a value is always straightforward. > > Ian > > —— > > Will C++ do move more often and do copy less often with its specific move > semantics. C++ will do move whenever possible, right? > > Will Golang, C do copy more than C++ because Golang, C don’t have move > semantics. So will C++ perform better than Golang, C? > > Move is nothing special. It is not a pointer assignment plus a pointer reset. You can achieve the move functionality in C and Go by custom code. In fact, for many cases, pointer reset operations are not essential. >From the point of view, move is a little slower than non-move operations.
-- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.