|
|
|
|
|
by scoutt
1492 days ago
|
|
Just chill, OskarS. I know the difference between compiled code and source code. Regarding std::optional, I even admitted "I don't know the overhead of possibly duplicating...". 30KB was a ballpark about exceptions plus std in general, by including things you expect to use when using std (like std::string). The patterns I knew and saw with std::optional usually returned "new something", but yeah, you can return a copy too if the class fits in the stack. And I am not religiously and irrationally opposed to anything. > really rubs me the wrong way Relax, my friend. Life is short. |
|
Oh, fer crying out loud... It DOES NOT return a copy, it constructs it directly in place. This is called "copy elision" (also known as "return value optimization", or RVO), and has been done by compilers for three decades, and is actually mandated behaviour in modern C++. I don't know where you saw these examples, but you would never use operator new with std::optional: it takes a value, not a pointer.
You have a very annoying style of being wrong about absolutely everything you say, and then acting superior about it when people call you on your bullshit.