From: William S F. <ws...@fu...> - 2009-03-21 17:22:57
|
Snowdrop Short wrote: > Hi > > I'm having problems with writing an ignore which will prevent this > warning: > > this is what the code looks like: > > namespace osg { > class Vec3f > { > public: > typedef float value_type; > /** Dot product. */ > value_type operator * (const Vec3f& rhs) const; > }; > > class Vec4d > { > public: > typedef double value_type; > /** Dot product. */ > value_type operator * (const Vec4d& rhs) const; > }; > > /** Compute the dot product of a Vec4d and a (Vec3,1.0). */ > inline Vec4d::value_type operator * (const Vec4d& lhs,const Vec3f& rhs) > { > return lhs[0]*rhs[0]+lhs[1]*rhs[1]+lhs[2]*rhs[2]+lhs[3]; > } > } > > note, I've removed a lot of other stuff, which isn't important for my > problem. > > the problems arises when trying to ignore: > Vec4d::value_type operator * (const Vec4d& lhs,const Vec3f& rhs) > > I have tried: > %ignore osg::Vec4d::operator*(const osg::Vec4d& lhs,const osg::Vec3f& > rhs); > %ignore osg::Vec4d::operator*(const Vec4d& lhs,const Vec3f& rhs); > %ignore osg::Vec4d::operator*(const osg::Vec4d&,const osg::Vec3f&); > %ignore osg::Vec4d::operator*(const Vec4d&,const Vec3f&); > %ignore osg::Vec4d::operator*(Vec4d&,Vec3f&); > %ignore osg::Vec4d::operator*(Vec4d,Vec3f); > > without any success, can somebody help me with the correct syntax? > You've got an error in your scoping of operator *. So use: %ignore osg::operator *; or if you want the parameters specified too, they must match exactly (extra scoping isn't recognised), so use: %ignore osg::operator * (const Vec4d& lhs,const Vec3f& rhs); William |