Oh, also interesting
by the way, should it be std::move(*this) in the first variant?
i couldn't find a source so i started testing. you were right, return *this causes a copy. but return std::move(*this); calls the move constructor. it seems there is no way to completely avoid a function call.
https://godbolt.org/z/fs53Whvz5
Anonymous
Pavel
Massi
Vlad
Diego
Swostik
Sandro
H
Meftahi
MRT
Ammar
klimi
HaiNahi
Gulshan
Ludovic 'Archivist'
كتابة بحوث 💻