How to bind friend operators in GCC?
Taesoo Kwon <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
The following binding definitions works in MS VC++.
.def("__mul", (vector3 (*)(matrix3 const& a, vector3 const&
b))&operator*)
.def("__mul", (vector3 (*)(vector3 const& b, matrix3 const&
a))&operator*)
.def("__mul", (matrix3 (*)(matrix3 const& a, matrix3 const&
b))&operator*)
class matrix3
{
...
friend vector3 operator*(matrix3 const& a, vector3 const& b);
friend vector3 operator*(vector3 const& b, matrix3 const& a);
friend matrix3 operator*(matrix3 const& a, matrix3 const& b) {
matrix3 c; c.mult(a,b); return c;}
...
};
However the same binding gives an error message in GCC.
error: address of overloaded function with no contextual type information
I am not familiar with GCC nor am sure if the binding definition is standard
C++ or not.
But is there any way work around this (other than writing a wrapper
function)?
Thanks,
Taesoo.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user