April 24, 2014
On Thursday, 24 April 2014 at 06:08:11 UTC, Jacob Carlborg wrote:
> On 24/04/14 00:29, Martin Nowak wrote:
>
>> Looks fairly interesting, because it partly solves the issue to allow
>> custom rtinfo.
>
> I don't like this solution for custom RTInfo. It requires you to change your type. I would rather modify the compiler to do something like this:
>
> * Add a UDA to druntime: "core.attributes.rtInfo"
>
> * If any template has the core.attributes.rtInfo UDA attached to itself, instantiate that as is done with core.RTInfo

I guess this could be done without modifying the compiler, just extend RTInfo(T) to support this UDA, but there's a problem with attributes. They don't propagate to class' children, thus they can't solve the main question of this topic.
April 24, 2014
> I guess this could be done without modifying the compiler, just extend RTInfo(T) to support this UDA, but there's a problem with attributes. They don't propagate to class' children, thus they can't solve the main question of this topic.
But as an additional feature such UDA might be useful.
April 24, 2014
Also, this whole thing is not only about RT registration, it may be used differently. The next usage that comes to mind after RT is validating proper inheritance. E.g. Some root class wants it's subclasses to always have a default ctor available, which again can be verified in CT.
April 24, 2014
On Thursday, 24 April 2014 at 06:08:11 UTC, Jacob Carlborg wrote:
> On 24/04/14 00:29, Martin Nowak wrote:
>
>> Looks fairly interesting, because it partly solves the issue to allow
>> custom rtinfo.
>
> I don't like this solution for custom RTInfo. It requires you to change your type. I would rather modify the compiler to do something like this:
>
> * Add a UDA to druntime: "core.attributes.rtInfo"
>
> * If any template has the core.attributes.rtInfo UDA attached to itself, instantiate that as is done with core.RTInfo

This is technically almost identical to having a special _RTInfo template within the type, but it's a cleaner solution.
April 24, 2014
rtInfo through attributes implemented. Jacob, have i done it the way you wanted?

https://github.com/D-Programming-Language/druntime/pull/775#issuecomment-41278520
1 2
Next ›   Last »