Am 06.04.2012 17:17, schrieb Adam D. Ruppe:
On Friday, 6 April 2012 at 15:07:04 UTC, Manu wrote:
But maybe the function approach has an
effect on the simplicity of the expression for a simple attribute,
like a single bool?
Meh, it is pretty similar:
struct Serializable { bool yes; }
bool Serializable(bool yes) { return yes; }
There's one difference I think.
struct approach:
struct Area { int x, y; }
Area sqare(int a) { return Area(x, y); }
//foo and bar are attributed the same
@Area(5, 5) int foo();
@square(5) int bar();
whereas with the function approach:
@area(5, 5) int foo();
@square(5) int bar();
foo and bar have different attributes.
The problem is you can't define forwarding functions because the symbol
is the attribute type. This seems to be a major problem to me.
Mafi