Possible bug in RVO?

Yuxuan Shui via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Apr 3 20:28:01 PDT 2016


I have encountered a weird bug.

I defined a Set class, which has a opBinary!"-". And somehow this:

auto tmp = set_a-set_b;

produces different results as this:

set_a = set_a-set_b;

the latter will produce an empty set.

I tried to reduce the source code to get a test case. But this 
problem just goes away after removing some code.

Any ideas what I could have done wrong?


More information about the Digitalmars-d-learn mailing list