This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module e; | |
struct Date | |
{ | |
//Make sure this is not a POD | |
this(this){} | |
short _year = 2; | |
ubyte _month = 1; | |
ubyte _day = 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module e; | |
struct Date | |
{ | |
//Make sure this is not a POD | |
this(this){} | |
short _year = 2; | |
ubyte _month = 1; | |
ubyte _day = 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dump of assembler code for function _Dmain: | |
0x0805c35c <+0>: push %ebp | |
0x0805c35d <+1>: mov %esp,%ebp | |
0x0805c35f <+3>: sub $0x8,%esp | |
0x0805c362 <+6>: mov 0x806f65c,%eax ;d = Date() | |
0x0805c367 <+11>: mov %eax,-0x8(%ebp) ; | |
0x0805c36a <+14>: lea -0x8(%ebp),%ecx ;ecx = &d | |
0x0805c36d <+17>: push %ecx | |
0x0805c36e <+18>: lea -0x4(%ebp),%eax ;eax = © | |
0x0805c371 <+21>: call 0x805c2dc <_D1e4Date8__cpctorMxFKxS1e4DateZv> ;copy = d, __postblit(copy) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Date | |
{ | |
uint data; | |
~this(){data = 10;} //non-POD | |
this(this) {data = 42;} | |
} | |
void func(Date d) {d.data++;} | |
void main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; AT&T syntax | |
Dump of assembler code for function _Dmain: | |
0x0805c3ac <+0>: push %ebp | |
0x0805c3ad <+1>: mov %esp,%ebp | |
0x0805c3af <+3>: sub $0x8,%esp | |
0x0805c3b2 <+6>: push %ebx | |
0x0805c3b3 <+7>: push %esi | |
0x0805c3b4 <+8>: push %edi | |
0x0805c3b5 <+9>: movl $0x2a,-0x8(%ebp) ;d = Date(42) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.string; | |
struct Date | |
{ | |
this(int) | |
{ | |
} | |
short _year = 2; | |
ubyte _month = 1; | |
ubyte _day = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.string; | |
struct Date | |
{ | |
this(int) | |
{ | |
} | |
short _year = 2; | |
ubyte _month = 1; | |
ubyte _day = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RedBlackTree(alias less) | |
{ | |
int a; | |
int nested() | |
{ | |
return a; | |
} | |
struct Range | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RedBlackTree(alias less) | |
{ | |
int a; | |
struct Range | |
{ | |
auto @property empty() | |
{ | |
return a; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RedBlackTree(alias less) | |
{ | |
int a; | |
struct Range | |
{ | |
auto @property empty() | |
{ | |
return a; | |
} | |
} |