Thread: auto_ptr

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    3

    Unhappy auto_ptr

    Hi,

    I have got a problem that i cant seem to fix ,

    I wanted to implement auto pointers into an application that im doing, but the problem is that the compiler fails.

    here is a code snippet

    #include <memory>

    class Name
    {
    Name();
    ~Name();
    };


    int main(void)
    {
    auto_ptr <Name> SafePtrName;
    ...
    ...
    ...
    return 0;
    }

    the compiler comes up with three errors, two syntax and one say that says its missing storage-class or type specifiers

    Is there a library that i need to add or another header file to include???

    Please could someone help as I have tried making new projects within visual studio .net and still getting the same result

    Thanks in advance

    Hyder Ali

  2. #2
    Registered User
    Join Date
    Jun 2004
    Posts
    201
    as always standard library thingies are in the std namespace

    std::auto_ptr

Popular pages Recent additions subscribe to a feed