Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Pass the address of the block of memory to the constructor along with your other arguments and perhaps the length of the memory block (to assert that sizeof(block) >= sizeof(object)). Then use a C-style cast to cast the block of memory to your class. Construct the object like normal and return the address.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: