I want to add a Phobos module with template mixins for common idioms.

Jacob Carlborg doob at me.com
Mon May 6 23:41:27 PDT 2013


On 2013-05-07 01:20, Idan Arye wrote:

> However, your idea of having a single mixin handle all the
> class\struct's properties gave me another idea - to use a single mixin,
> but instead of having it analyze the owner class to find the fields we
> want to make properties, we simply give them to it with a token string:
>
>      class Foo
>      {
>          mixin properties!q{
>              @asserting(`a < 50`)     int x = 1;
>              @verifying(`a !is null`) string y = "hello";
>              @privateSetter           double z = 44.4;
>          };
>      }

Please no strings, it's horrible.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list