J
Jarek Blakarz
Hi
I would like to pass std::auto_ptr as boost::shared_ptr.
When I do that I receive the following compile error:
conversion from ‘std::auto_ptr<Human>’ to non-scalar type ‘boost::shared_ptr<Human>’ requested
How can I do that correctly ?
#include <memory>
#include <boost/shared_ptr.hpp>
using namespace std;
using namespace boost;
class Human {};
void fun (shared_ptr<Human> s) {}
int main(void)
{
auto_ptr<Human> hAP (new Human);
fun (hAP);
return 0;
}
thanks for help
I would like to pass std::auto_ptr as boost::shared_ptr.
When I do that I receive the following compile error:
conversion from ‘std::auto_ptr<Human>’ to non-scalar type ‘boost::shared_ptr<Human>’ requested
How can I do that correctly ?
#include <memory>
#include <boost/shared_ptr.hpp>
using namespace std;
using namespace boost;
class Human {};
void fun (shared_ptr<Human> s) {}
int main(void)
{
auto_ptr<Human> hAP (new Human);
fun (hAP);
return 0;
}
thanks for help