[OT] Generative C++

12345swordy via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 28 09:42:33 PDT 2017


On Friday, 28 July 2017 at 16:04:00 UTC, Stefan Koch wrote:
> On Friday, 28 July 2017 at 15:41:28 UTC, 12345swordy wrote:
>> On Friday, 28 July 2017 at 15:12:29 UTC, Stefan Koch wrote:
>>> On Friday, 28 July 2017 at 15:09:32 UTC, 12345swordy wrote:
>>>> On Friday, 28 July 2017 at 14:46:46 UTC, Stefan Koch wrote:
>>>>> On Friday, 28 July 2017 at 14:39:04 UTC, 12345swordy wrote:
>>>>>> [...]
>>>>>
>>>>> Yes we can do that with mixins __traits and ctfe.
>>>>
>>>> Can you provide a simple example of this? Thanks.
>>>
>>> Sure look at 
>>> https://gist.github.com/UplinkCoder/b3501425a4fb4992c6cf1c77d6c3638a
>>> Which will inject propery-methods into a struct to build a 
>>> costum bitfield.
>>
>> ... That's not what I consider to be "simple" (Hard to read 
>> IMO).
>
> Is it simpler using meta-classes ?

I don't know, it still a proposal in this stage. Though looking 
through the d documentation I don't see any _traits that returns 
the the body of function/struct/class in string format for the 
std regex to parse.


More information about the Digitalmars-d mailing list