________________________________
From: Paul Herring <[email protected]>
To: [email protected]
Sent: Wed, 6 January, 2010 12:02:44 AM
Subject: Re: [c-prog] how to call destructor with namespace
On Tue, Jan 5, 2010 at 6:10 PM, manish bhatia <mb_mani...@yahoo. com> wrote:
[...]
> Yeah, I see that. But I was expecting to find a way to explicitely call the
> destructor without dropping "std:". The code-example doen't say anything like
> that. :(
#include <iostream>
#include <new>
#include <string>
int main()
{
char* mem = new char[sizeof( std::string) ];
void* place = mem;
std::string* s = new(place)std: :string(" manish");
std::cout << *s << std::endl;
s->std::string: :~string( );
delete[] mem;
}
--
PJH
Thanks Paul!
The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
http://in.yahoo.com/
[Non-text portions of this message have been removed]