Menu

#42 Wrapper for abstract base class won't compile

open
nobody
None
5
2012-12-19
2012-12-19
No

If one excludes a pure virtual member function of an abstract base class then Py++ will generate a wrapper class for it that won't compile because it doesn't contain an override for the excluded pure virtual function.

For example:

namespace example
{

class Interface
{
public:

virtual void ignoreMe() const = 0;

}

} // namespace example

example = mb.global_ns.namespace('example')
Interface = example.class_('Interface')
Interface.member_function('ignoreMe').exclude()

boost-1.46.1/boost/python/object/value_holder.hpp(66): error: object of abstract class type "Interface_wrapper" is not allowed:
pure virtual function "example::Interface::ignoreMe(...) const" has no overrider
Value m_held;
^boost/python/object/value_holder.hpp(66): error: object of abstract class type "Interface_wrapper" is not allowed:
pure virtual function "example::Interface::ignoreMe(...) const" has no overrider
Value m_held;
^

This bug was encountered in revision 1856.

Discussion


Log in to post a comment.