On Wednesday, 6 April 2016 at 13:59:42 UTC, pineapple wrote:
Is there any way in D to define static methods or members
within an enum's scope, as one might do in Java? It can
sometimes help with code organization. For example, this is
something that coming from Java I'd have expected to be vali
On Wednesday, 6 April 2016 at 13:59:42 UTC, pineapple wrote:
Is there any way in D to define static methods or members
within an enum's scope, as one might do in Java? It can
sometimes help with code organization. For example, this is
something that coming from Java I'd have expected to be vali
On Wednesday, 6 April 2016 at 13:59:42 UTC, pineapple wrote:
Is there any way in D to define static methods or members
within an enum's scope, as one might do in Java? It can
sometimes help with code organization. For example, this is
something that coming from Java I'd have expected to be vali
On Wednesday, 6 April 2016 at 13:59:42 UTC, pineapple wrote:
Is there any way in D to define static methods or members
within an enum's scope, as one might do in Java?
No. You could make a struct rather than an enum though with the
methods, and a bunch of static things to simulate SomeEnum.NOR
Is there any way in D to define static methods or members within
an enum's scope, as one might do in Java? It can sometimes help
with code organization. For example, this is something that
coming from Java I'd have expected to be valid but isn't:
enum SomeEnum{
NORTH, SOUTH, EAST, WEST;