however, it'd be better to return an auto_ptr<T>, so if something bad happens ptr still gets deleted. sizeof(auto_ptr<T>) returns 4 bytes, so theoretically i should be able to cast it to INT_PTR, but that doesn't seem to work, and it can't be the correct solution anyway.
and if I write a wrapper class A with auto_ptr<T> as a data .member, i'll have to create an A object on the heap in order to return a pointer, which defeats the whole purpose anyway.
maybe i'll just have to return the raw pointer and put it in an auto_ptr right away, but I was hoping for a safer method...