Skip to main content
GameDev.net gamedev.net
šŸ”’ Locked

VS2005 auto_ptr bug

Started by rozz666 Oct 16, 2008 at 3:47 AM 1 replies 700+ views
Original Post
rozz666
rozz666
The following code compiles without problems:

#include <memory>

struct X { };
strucy Y { };

int main()
{
    std::auto_ptr<X> x(new Y);
}
I found out it's because it uses implicit conversion from auto_ptr_ref which takes void * as a parameter. Is it a known bug? Is there a way to fix without modifying their SCL implementation?
dave
dave
Looks like it's been fixed in VS2008. Doesn't compile for me.
MaulingMonkey
MaulingMonkey
Uhg, I remember getting bitten by that awhile back. I didn't bother fixing the stdlib as I very rarely use std::auto_ptr (instead I prefer to use boost::scoped_ptr whenever possible).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.