Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum xxx = false;
- struct A {
- static if (xxx) {
- ref A opAssign(ref const A a) {
- return this;
- }
- }
- ref A opAssign(int v) {
- return this;
- }
- }
- struct B {
- A a;
- alias a this;
- }
- void main() {
- A a;
- B b;
- b = a; // With xxx == true this gives an error, but it compiles fine with xxx == false.
- a = b; // With xxx == false this gives an error, but it compiles fine with xxx == true.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement