Call boost :: scoped_ptr in boost :: python

I get a compilation error saying that the scoped_ptr copy scoped_ptr is private with the following code snippet:

 class a {}; struct s { boost::scoped_ptr<a> p; }; BOOST_PYTHON_MODULE( module ) { class_<s>( "s" ); } 

This example works with shared_ptr. It would be nice if anyone knows the answer. Thanks

+4
source share
1 answer

The semantics of boost::scoped_ptr prohibits copying, while shared_ptr is for copying. The error you get is a compiler telling you that some of the code (a macro extension?) Is trying to copy scoped_ptr , but the library does not allow a copy.

+6
source

Source: https://habr.com/ru/post/1306009/


All Articles