Hi,

If I uncomment the commented line (and comment the 2 following lines) in the 
following code, I get syntax error with gcc-4.2.4

error: expected class-name before '::' token
error: expected `;' before '::' token

How to write it correctly without dropping "std::"?


#include <iostream>
#include <new>
#include <string>
int main()
{
    char* mem = new char[sizeof(std::string)];
    std::string& s = *new(mem) std::string("manish");
    std::cout << s << std::endl;

    // s.~std::string();
    using std::string;
    s.~string();

    delete[] mem;
}



      The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. 
http://in.yahoo.com/

[Non-text portions of this message have been removed]

Reply via email to