Am 22.04.2012 22:11, schrieb sclytrack:
struct Dispatcher { @property void opDispatch(string name)(string val) { writeln(val); } @property string opDispatch(string name)() { return "getter"; } void opDispatch(string name)() { writeln(name); } } I can't seem to make a "dispatcher" that supports both the normal method syntax and the property syntax simultaneously. Is this going to change in the future? And if so, how will this be done? Like this? struct Dispatcher { @property void opPropDispatch(string name)(string val) { writeln(val); } @property string opPropDispatch(string name)() { return "getter"; } void opDispatch(string name)() { writeln(name); } } I've got absolutely no clue.
For now you can do it *without* @property and compile *without* -property