custom attribute proposal (yeah, another one)

Jacob Carlborg doob at me.com
Sat Apr 7 07:04:54 PDT 2012


On 2012-04-06 19:51, bls wrote:

> Why not being more flexible .. Likewise
>
> struct Annotation //Throw in all your annotations
> {
>
> Variant[] [string] map;
>
> Variant[] opDispatch(string key)()
> {
> return map[key];
> }
>
> // Single value
> Variant[] opDispatch(string key, T) (T t )
> if ( !isArray!T && !isTuple!T )
> {
> index ~= key;
> map[key] ~= to!Variant(t);
> return map[key];
> }
> ....Array, Tuple
> }
> well.. I am not sure about CTFE

Variant yet again. What with this Variant all the time.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list