Is there a way to mark a class as "not copyable"?

Asked by Paul Melis

In Boost.Python you can mark classes with boost::noncopyable, which will suppress any attempts at creating copies of objects of that class. Is there similar functionality in Pybindgen? I'm trying to wrap a class that has a public parameter-less constructor but a protected copy constructor and a protected assignment operator. Pybindgen complains that

Class '...' has a protected constructor and no helper class -> cannot generate a constructor for it

even though only the copy constructor is protected.

Question information

Language:
English Edit question
Status:
Answered
For:
PyBindGen Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Gustavo Carneiro (gjc) said :
#1

Hm.. sounds like a bug.

In pybindgen, marking a class non-copyable is simply a fact of the class not having a public copy constructor. Then PBG should do the right thing, or if not it's a bug to be fixed.

Can you help with this problem?

Provide an answer of your own, or ask Paul Melis for more information if necessary.

To post a message you must log in.