Subject: Re: [boost] [operators] A modern SFINAE-based version of boost::operators?
From: Daniel Frey (d.frey_at_[hidden])
Date: 2017-11-16 06:20:55
> On 16. Nov 2017, at 02:39, Gavin Lambert via Boost <boost_at_[hidden]> wrote:
> On 16/11/2017 05:41, Peter Dimov wrote:
>> It's all slightly misleading anyway, because for the small matrix case the copy/move constructors don't actually have side effects and therefore get optimized out; they are only relevant in the case of something like std::string where copy/move aren't defaulted.
> That was my point; your test code doesn't test copy elision because your constructors have side effects, so can't be elided.
Copy elision (RVO/NRVO) is part of the standard only because it allows the compiler to elide a copy-ctor even if it has side-effects. In other words, if the compiler would apply copy elision, you would see the side-effects to change.