On Monday, 30 November 2015 at 16:06:43 UTC, Steven Schveighoffer wrote:
MyCollection!(int) c1;
auto c2 = c1;
c1 ~= 1;

assert(c2.contains(1)); // pass? fail?

BTW, I third Jonathan's and Timon's suggestion -- go with an external factory function. Use IFTI to its fullest!

-Steve

That should throw, because you're using an uninitialised reference (c1). It's the equivalent to:

Class C { .. }

C c1;
C c2 = c1;
c1.foo(); // call via nullptr

Or it needs to pass, but that's probably not worth it.

Reply via email to