Skip to content

Commit

Permalink
fix Issue 1570 - Wrong return for address operator
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Jan 22, 2012
1 parent 34b168f commit 9d33103
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions class.dd
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,20 @@ Foo var;
<h3>Fields</h3>

$(P Class members are always accessed with the . operator.
There are no :: or -&gt;
operators as in C++.
)

$(P Members of a base class can be accessed by prepending the name of
the base class followed by a dot:)

---
class A { int a; }
class B : A { int a; }

void foo(B b) {
b.a = 3; // accesses field B.a
b.A.a = 4; // accesses field A.a
---

$(P The D compiler is free to rearrange the order of fields in a class to
optimally pack them in an implementation-defined manner.
Consider the fields much like the local
Expand Down

0 comments on commit 9d33103

Please sign in to comment.