User defined attributes use

matovitch camille.brugel at laposte.net
Sun Sep 15 10:34:05 PDT 2013


Hi everyone,

I read the documentation about user defined attributes, but I 
don't see their uses. Ok, it'a a template expression you can link 
to a declaration, but what are they useful for ? (not sure about 
the syntax ;-))

Can you declare a template constraint as a user defined attribute 
to do something like :

void template_function_which_go_back_and_forth(@("Bidirectional") 
@("Range") BR)(BR br) {...}

This would be awesome (even if not really occidental) to do 
something like:

@("SmallTypeSet") @("MediumTypeSet") @("LargeTypeSet") Type

This could allow to build tree based category structure.


More information about the Digitalmars-d-learn mailing list