File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,22 @@ ubyte asciiChar;
135
135
-------------------------------
136
136
)
137
137
138
+ $(DT $(LNAME2 naming_udas, User-Defined Attributes))
139
+ $(DD For symbols that are only to be used as user-defined attributes the
140
+ names should be camelCased, so their first letter is lowercase. This
141
+ convention takes precedence over any previously mentioned conventions.
142
+ This matches conventions of the built in attributes like `@safe`,
143
+ `@nogc` and the special compiler recognized UDA `@selector`.
138
144
145
+ -------------------------------
146
+ struct Foo {} // this struct follows the regular naming conventions
147
+
148
+ // this struct is only intended to be used as an UDA and therefore overrides the
149
+ // regular naming conventions for structs
150
+ struct name { string value; }
151
+ @name("bar") Foo foo;
152
+ -------------------------------
153
+ )
139
154
)
140
155
141
156
$(H3 $(LNAME2 type_aliases, Type Aliases))
You can’t perform that action at this time.
0 commit comments