Skip to content

Commit 1b5a753

Browse files
authored
Merge pull request #3711 from pbackus/update-offsetof-example
Remove outdated example for class .offsetof
2 parents 56aab4c + e199b10 commit 1b5a753

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

spec/class.dd

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -167,26 +167,8 @@ $(H3 $(LNAME2 field_properties, Field Properties))
167167
from the beginning of the class instantiation.
168168
`.offsetof` is not available for fields of `extern(Objective-C)` classes
169169
due to their fields having a dynamic offset.
170-
$(D .offsetof) can only be applied to
171-
expressions which produce the type of
172-
the field itself, not the class type:
173170
)
174171

175-
------
176-
class Foo
177-
{
178-
int x;
179-
}
180-
...
181-
void test(Foo foo)
182-
{
183-
size_t o;
184-
185-
o = Foo.x.offsetof; // error, Foo.x needs a 'this' reference
186-
o = foo.x.offsetof; // ok
187-
}
188-
------
189-
190172
$(H2 $(LNAME2 class_properties, Class Properties))
191173

192174
$(P The $(D .tupleof) property is an

0 commit comments

Comments
 (0)