Constructor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It is a mistake of the compiler. You cannot know the size of the object created, You have to ask. So, The dynamic constructor

size_t String::?String(char const*)

is essential. You can give back the dynamic size in the common constructor with sizeof(this) and tell the compiler the object has dynamic size.

My basic goal is to get auto recognize my Handle which up-casts to String* (void*).

auto str=new String("abc")

with only calling the mutex-protected heap one time.

Best regards,

Sven

(Freeware)






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux