Quantcast

[C++-sig] what does this message mean?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[C++-sig] what does this message mean?

Alexis H. Rivera-Rios
Can somebody explain why this message occurs?

aclass.MyFunction(object1, object2)
did not match C++ signature:
    MyFunction(class A{lvalue}, class
boost::shared_ptr<B> >)

I get the error when object2 is a python class that
implements the interface specified by B.

class Object2Class(B):
   def(self):
      self.something
   def functionFromB(self):
      # do something here

What is the correct way of passing this kind of object
to C++?

Any help will be greatly appreciated.

Thanks,
Alexis



Programming Tutorial:
In Python: To do this, do this
In Perl: To do this, do this or this or this or this...
In C: To do this, do this, but be careful
In C++: To do this, do this, but don't do this, be careful of this, watch out for this, and whatever you do, don't do this


               
__________________________________
Yahoo! Mail for Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail 
_______________________________________________
C++-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/c++-sig
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [C++-sig] what does this message mean?

David Abrahams
"Alexis H. Rivera-Rios" <[hidden email]> writes:

> Can somebody explain why this message occurs?
>
> aclass.MyFunction(object1, object2)
> did not match C++ signature:
>     MyFunction(class A{lvalue}, class
> boost::shared_ptr<B> >)

That's not the actual message, is it?  The first line looks specific.

> I get the error when object2 is a python class that
> implements the interface specified by B.

the problem is that you're calling a C++ function.
"Implements the interface" isn't enough; it needs to be an instance of
the Python class that wraps B, and its __init__ function needs to have
been called to initialize the contained C++ B object.  IOW, there has
to be a real, C++ B object there.

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

_______________________________________________
C++-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/c++-sig
Loading...