Skip to content

Instantly share code, notes, and snippets.

class RedBlackTree(alias less)
{
int a;
int nested()
{
return a;
}
struct Range
{
import std.string;
struct Date
{
this(int)
{
}
short _year = 2;
ubyte _month = 1;
ubyte _day = 1;
import std.string;
struct Date
{
this(int)
{
}
short _year = 2;
ubyte _month = 1;
ubyte _day = 1;
; 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)
struct Date
{
uint data;
~this(){data = 10;} //non-POD
this(this) {data = 42;}
}
void func(Date d) {d.data++;}
void main()
module e;
struct Date
{
//Make sure this is not a POD
this(this){}
short _year = 2;
ubyte _month = 1;
ubyte _day = 1;
}
module e;
struct Date
{
//Make sure this is not a POD
this(this){}
short _year = 2;
ubyte _month = 1;
ubyte _day = 1;
}
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 = &copy
0x0805c371 <+21>: call 0x805c2dc <_D1e4Date8__cpctorMxFKxS1e4DateZv> ;copy = d, __postblit(copy)
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 9ab2aa9..840d9cc 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -35,7 +35,7 @@ AM_CFLAGS = $(WARN_CFLAGS)
AM_CPPFLAGS = -DBINDIR='"$(bindir)"'
if PLUGINS
bfdinclude_HEADERS += $(INCDIR)/plugin-api.h
-LIBDL = -ldl
+LIBDL = @lt_cv_dlopen_libs@
import std.stdio;
struct Date
{
this(this){writeln("this(this)");}
~this(){writeln("~this()");};
uint data;
}
void test(Date d)