Hello all I have stupid question regarding constructors and destructors in c++. After compilation there are two assembler functions (__ZN4testC2Ev, __ZN4testC1Ev) that represent constructor, same is for destructors (__ZN4testD2Ev, __ZN4testD1Ev). Functions are completely the same. What is the reason for such compilere behaviour?
Here is small sample: class test { public: test(); ~test(); }; test::test() { } test::~test() { } Here is output after objdump: SYMBOL TABLE: [ 2](sec 1)(fl 0x00)(ty 20)(scl 2) (nx 1) 0x00000000 __ZN4testC2Ev [ 4](sec 1)(fl 0x00)(ty 20)(scl 2) (nx 0) 0x00000006 __ZN4testC1Ev [ 5](sec 1)(fl 0x00)(ty 20)(scl 2) (nx 0) 0x0000000c __ZN4testD2Ev [ 6](sec 1)(fl 0x00)(ty 20)(scl 2) (nx 0) 0x00000012 __ZN4testD1Ev .... Disassembly of section .text: 00000000 <__ZN4testC2Ev>: 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 5d pop %ebp 4: c3 ret 5: 90 nop 00000006 <__ZN4testC1Ev>: 6: 55 push %ebp 7: 89 e5 mov %esp,%ebp 9: 5d pop %ebp a: c3 ret b: 90 nop 0000000c <__ZN4testD2Ev>: c: 55 push %ebp d: 89 e5 mov %esp,%ebp f: 5d pop %ebp 10: c3 ret 11: 90 nop 00000012 <__ZN4testD1Ev>: 12: 55 push %ebp 13: 89 e5 mov %esp,%ebp 15: 5d pop %ebp 16: c3 ret Thanks in advanced Mile