On Sat, 5 Mar 2005 23:46:09 +0100, "Peter Koch Larsen"
<pk*****@mailme.dk> wrote:
"Last Timer" <da********@yahoo.com> skrev i en meddelelse
news:11**********************@l41g2000cwc.googleg roups.com... Checked the FAQ. Can someone please give examples of how new can be
overloaded/assign memory at a known address.
Thanks
void* adress = ... ;
myclass *mc = new(adress) myclass(...);
/Peter
This use of the new operator Peter shows is called "placement new" and
is covered in the C++ FAQ LITE in the section on destructors. If you
wish to use placement new, these portions of the FAQ are highly
recommended reading.
[11.10] What is "placement new" and why would I use it?
http://www.parashift.com/c++-faq-lit...html#faq-11.10
[11.14] Is there a way to force new to allocate memory from a specific
memory area?
http://www.parashift.com/c++-faq-lit...html#faq-11.14
--
Kanenas