Skip to content

Commit

Permalink
Merge pull request #336 from denis-sh/typecons-improvement
Browse files Browse the repository at this point in the history
Convert unnecessary flag `opDispatch` property functions to templates
  • Loading branch information
andralex committed Dec 4, 2011
2 parents 9ffb83e + bee2f5a commit b3c0ce2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions std/typecons.d
Expand Up @@ -2883,16 +2883,20 @@ Flag!"encryption".no).
*/
struct Yes
{
static auto @property opDispatch(string name)() { return
Flag!name.yes; }
template opDispatch(string name)
{
enum opDispatch = Flag!name.yes;
}
}
//template yes(string name) { enum Flag!name yes = Flag!name.yes; }

/// Ditto
struct No
{
static auto @property opDispatch(string name)() { return
Flag!name.no; }
template opDispatch(string name)
{
enum opDispatch = Flag!name.no;
}
}
//template no(string name) { enum Flag!name no = Flag!name.no; }

Expand Down

0 comments on commit b3c0ce2

Please sign in to comment.