opDispatch with string mixin does not work as I would expect.

German Diago germandiago at gmail.com
Sat Feb 10 08:43:07 UTC 2018


On Saturday, 10 February 2018 at 07:47:58 UTC, Nicholas Wilson 
wrote:
> On Saturday, 10 February 2018 at 06:32:43 UTC, German Diago

> Alternatively you could do something like
>
>>     auto opDispatch(string name)() 
>> if(hasMember!(HeaderData,name){
>>           readHeader();
>>           return mixin("headerData." ~ name);
>>     }

Do not ask me why but now seems to work with my initial solution. 
:)



More information about the Digitalmars-d-learn mailing list