List Info

Thread: class operators/template problem with boost.python




class operators/template problem with boost.python
user name
2008-02-05 17:13:48
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&dis
tributionid=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/
_______________________________________________
Boost-langbinding mailing list
Boost-langbindinglists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/boost
-langbinding

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )