One can overload assignment and dispatch so that something like

A.x = ... is valid when x is not a typical member but gets resolved by the above functions.

Therefore, I can create a member for assignment. How can I create a member for getting the value?

A.x = 3; // Seems to get translated in to A.opDispatch!("x")(3)

works but

foo(A.x); // fails and the compiler says x does not exist


I need something consistent with opDot. I am trying to create "virtual"(not as in function) fields and I can only get assignment but not accessor.



Reply via email to