Using opDispatch as *magic* getter/setter. Possible or not?

Aleksandar Ružičić ruzicic.aleksandar at gmail.com
Wed Mar 30 17:32:35 PDT 2011


Is it possible to use opDispatch as generic getter and setter at the
same time? Something like __get() and __set() in PHP..

this is what I've tried: https://gist.github.com/895571

and I get Error: template instance opDispatch!("bar") matches more
than one template declaration, path\to\test.d(57):opDispatch(string
entryName) and path\to\test.d(66):opDispatch(string entryName)

Is mixing @property with opDispatch supposed to work at all or is
opDispatch only ment for method calls?

Or maybe there is some other way to achive what I want and I'm not
aware of it? :-)


More information about the Digitalmars-d-learn mailing list