Re: [C++-sig] Re: pure virtual methods with pyste
by Nicodemus other posts by this author
Aug 26 2003 12:48AM messages near this date
[C++-sig] Re: pure virtual methods with pyste
|
[C++-sig] Virus
David Abrahams wrote:
> OK, done; see <boost/python/pure_virtual.hpp>. Perhaps you should
> change Pyste to use this facility.
>
I did, but I am getting this compiler error:
pure.cpp
d:/programming/libraries/boost-cvs/boost/boost/python/detail/nullary_function_ad
aptor.hpp(33): catastrophic error: expected a file name
# include BOOST_PP_LOCAL_ITERATE()
^
Perhaps I am missing something? Here is the code:
// Includes
====================================================================
#include <pure.h>
#include <boost/python/pure_virtual.hpp>
#include <boost/python.hpp>
// Using
=======================================================================
using namespace boost::python;
// Declarations
================================================================
namespace {
struct A_Wrapper: A
{
A_Wrapper(PyObject* self_, const A& p0):
A(p0), self(self_) {}
A_Wrapper(PyObject* self_):
A(), self(self_) {}
void foo() {
call_method< void > (self, "foo");
}
PyObject* self;
};
}// namespace
// Module
======================================================================
BOOST_PYTHON_MODULE(pure)
{
class_< A, boost::noncopyable, A_Wrapper > ("A", init< >())
.def("foo", pure_virtual(&A::foo), &A_Wrapper::default_foo)
;
}
_______________________________________________
C++-sig mailing list
C++-sig@[...].org
http://mail.python.org/mailman/listinfo/c++-sig
Thread:
David Abrahams
David Abrahams
David Abrahams
Nicodemus
David Abrahams
Nicodemus
Nicodemus
David Abrahams
Nicodemus
David Abrahams
Nicodemus
Nicodemus
David Abrahams
David Abrahams
Nicodemus
David Abrahams
Nicodemus
David Abrahams
Nicodemus
David Abrahams
Nicodemus
Daniel Wallin
David Abrahams
Daniel Wallin
Nicodemus
David Abrahams
David Abrahams
David Abrahams
|