On Thursday, 26 June 2014 at 07:11:03 UTC, Uranuz wrote:
But if I write
@("hello") struct Hello {}
so all of the variables that have type Hello will have
attribute @("hello") like come type qualifier because attribute
is a part of declaration of Hello. Do I understand correctly?
No, it is o
But if I write
@("hello") struct Hello {}
so all of the variables that have type Hello will have attribute
@("hello") like come type qualifier because attribute is a part
of declaration of Hello. Do I understand correctly?
On Wednesday, 25 June 2014 at 17:21:21 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
The term "attribute" is a bit confusing, especially since
"property" is
also used in the language to refer to something completely
different. A
better term is perhaps "annotation". The @foo is an annotation
On Wed, Jun 25, 2014 at 05:10:06PM +, Chris Nicholson-Sauls via
Digitalmars-d-learn wrote:
> UDA's are compile-time metadata associated with a specific
> declaration. So in something like:
>
> @foo int x;
>
> The @foo is attached to x, but is not part of the type.
The term "attribute" is a
UDA's are compile-time metadata associated with a specific
declaration. So in something like:
@foo int x;
The @foo is attached to x, but is not part of the type.
I'm trying to declare format for database record in compile time.
I consider to use attributes fo this. Can I do something similar
to this code?
struct RecordFormat(T)
{}
alias Format = RecordFormat!( @("cool") int );
pragma( msg, Format );
void main()
{
}
Or I want something strang