On 2013-06-04 15:15, bearophile wrote:

My original purposes for UDAs was to extend the type system, as
you have essentially done here. But to do that well enough the
attributes need to be more active.

An idea:

struct Small(T) if (T.sizeof <= 16) {}

@Small struct Bar {
       int x;
}


Here Small get instantiated with T == Bar, and its constraint
performs the active compile-time test.

Absolutely. My idea for AST macros, which includes integration with UDA's, could possibly solve that.

https://dl.dropboxusercontent.com/u/18386187/ast_macros.html

See the bottom for attributes.

--
/Jacob Carlborg

Reply via email to