[go-nuts] Memory copy on return statement (copy elision)

2018-03-04 Thread Bruno Novais
Hello Gophers! As you probably noticed by my question, I'm new to this awesome language called Go (coming from C/C++). In C++ I rely a lot on constructor (copy) elision. I think Go doesn't have this concept, but I would like to know what happen when I do something like this: func NewStuff() St

Re: [go-nuts] Memory copy on return statement (copy elision)

2018-03-05 Thread Bruno Novais
ith Go. To be honest, I thought there was only one compiler avaliable out there for Go. Thank you for your time! Best Regards, Bruno Novais 2018-03-05 3:25 GMT-03:00 Ian Lance Taylor : > On Sun, Mar 4, 2018 at 5:57 AM, Bruno Novais > wrote: > > > > As you probably noticed by

Re: [go-nuts] Memory copy on return statement (copy elision)

2018-03-05 Thread Bruno Novais
analysis, thanks for pointing out the correct search term. Best Regards, Bruno Novais 2018-03-04 18:37 GMT-03:00 andrey mirtchovski : > Use 'go build -gcflags="-m"' to see what inlining actions the compiler > takes. more here: > https://github.com/golang/go/wiki/Comp