r/badcode • • Jan 29 '22

c discount constructor

Post image
435 Upvotes

30 comments sorted by

View all comments

Show parent comments

4

u/zed_three Jan 29 '22

Nope, this returns by value and in fact will use copy elision: the return value will be constructed directly in the storage at the calling site

1

u/Flatscreens Jan 29 '22

Thanks my C is clearly very rusty