[C++-sig] Re: Making copy of function derived from C++ pure virtual function

David Abrahams dave at boost-consulting.com
Tue Mar 22 23:57:49 CET 2005


"Paul F. Kunz" <Paul_Kunz at slac.stanford.edu> writes:

> Some time ago, I got this work under Linux with both gcc 2.95.3 and
> gcc 3.4.3.   Now I'm testing under Windows with VC++ 7.1 and having
> trouble.
>
> The first part of the wrapping code is...
>
> using namespace boost::python;
>
> namespace hippodraw {
>   namespace Python {
>     void
>     export_FunctionBase ()
>     {
>       class_ < FunctionWrap, std::auto_ptr < FunctionWrap> >
> 	( "FunctionBase", init < const FunctionBase & > () ) // line with error
> 	.def ( init < const FunctionWrap & > () )
> 	.def ( init <> () )
> 	.def ( "initialize", &FunctionWrap::initialize )
> 	.def ( "name", &FunctionBase::name,
> 	       return_value_policy < copy_const_reference > () )
> 	.def ( "setName", &FunctionWrap::setName )
>
> The VC++ build log is attached below

Was it filtered by something?  I can't see much of the information I'm
used to getting from VC++ there.

> and is saying can't instanciate FunctionBase because pure virtual
> functions have no definition.  These functions are defined in
> FunctionWrap.  Is this possibly a problem with VC++ or is gcc
> letting me get away with something.

Looks like a VC++ problem, though I don't know for sure.  Is
FunctionWrap copyable?  Otherwise you should use noncopyable in its
class_ and these errors might disappear.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Cplusplus-sig mailing list