Skip to content

Comment on Why should I have written ZeroMQ in C, not C++ (part II)parent

Comments

Actually in this particular case that "copy" is allowed to be elided even in C++98, as the copy constructor of person produces no side effects. It would be hard to notice if the optimizer is that smart or not either way though, since it will be optimized by redundant load/store elimination even if it was initially generated without optimization.

And that's the other reason of not using C++ sometimes - you just don't know exactly what happens.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.