On 2013-01-06 10:48, Philippe Sigaud wrote:

Walter, what is the official way to return an attributed value?

XXX? foo()
{
     @Marked int i;
     return i;
}

Don't know if this is what you want but:

struct Marked {}
struct Attrs (T...) {}

auto bar ()
{
    @Marked int i;
    return Attrs!(__traits(getAttributes, i))();
}

void main ()
{
    writeln(bar()); // prints Attrs!(Marked)()
}

--
/Jacob Carlborg

Reply via email to