class operators/template problem with boost.python
Marc Janz <[email protected]>
| Newsgroups | gmane.comp.lib.boost.langbinding |
|---|---|
| Organization | http://freemail.web.de/ |
| Message-ID | <[email protected]> |
Hello everyone,
i am new to Python and Boost.Python and trying to build a python module from an existing C++ Library.
I managed to wrap some code but came to a problem exposing operators for the following class, in example the python __add__ method (operator+):
class operand{
friend operand& operator+(operand&, operand&);
template friend operand& operator+(operand& Left, const scalar& r);
};
Note that the parameters are not consts. Unfortunately it was not possible to use
"operand_exposer.def( bp::self * bp::self );"
for wrapping. From the error message i get on compiling, i guess it doesnt know which function to use and/or needs functions defined for each datatype i want to use with the template:
error: no matching function for call to operand::operand(const operand&)
note: candidates are: ....
How could i get this to work? Btw. I am not able/allowed to modify the existing C++ code. Thanks for your help.
Marc
________________________________________________________
Bis 50 MB Dateianhänge? Kein Problem!
http://www.digitaledienste.web.de/freemail/club/lp/?lp=7
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/