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
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066


-------------------------------------------------------------------------
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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.