> I have a strange problem with recent g++ while trying to get a pointer > on an overloaded function. > > To extract one specific version of the overloaded function I tried : > > float ( *v2d_cross )( const Vector2& , const Vector2& ) = cross; > > But then I get this error: > > src/wrappers/export_vertex.cpp|120| error: no matches converting > function 'cross' to type 'float (*)(const class Vector2&, const class > Vector2&)' > src/utils/amap_util_vector.h|236| error: candidates are: float > cross(const Vector2&, const Vector2&) > src/utils/amap_util_vector.h|514| error: Vector3 > cross(const Vector3&, const Vector3&)
don't know if you could ever get that to work, but at least i'm sure it does not work with most c++ compilers: there is no selection of a function through a 'to-be-casted-to' rule, to use pointers to members/pointers to function, you must have different names: you cannot 'overload'. Calling directly disambiguates/works because you have tangible argument to disambiguate. But casting does not give these arguments so the compiler cannot choose. Armel _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus