Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // outputs:
- // float
- // string
- import std.stdio;
- class Test
- {
- public @property float opDispatch(string s)()
- if (s.length == 1)
- {
- return 5.5;
- }
- public @property string opDispatch(string s)()
- if (s.length != 1)
- {
- return "hello";
- }
- }
- void main()
- {
- Test test = new Test;
- writeln(typeof(test.x).stringof);
- writeln(typeof(test.xy).stringof);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement