[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[g++-4.1] Strange problem with overloading
From: |
Pierre Barbier de Reuille |
Subject: |
[g++-4.1] Strange problem with overloading |
Date: |
Tue, 13 Jun 2006 16:20:52 +0100 |
User-agent: |
Thunderbird 1.5.0.2 (X11/20060516) |
Hello,
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&)
So I also tried this:
typedef float ( *r_cv2cv2 )( const Vector2&, const Vector2& );
r_cv2cv2 v2d_cross = cross;
But I get the exact same error.
At last, I tried to directly reference it :
typedef float ( *r_cv2cv2 )( const Vector2&, const Vector2& );
def("cross", (r_cv2cv2)cross); // This is a Boost.Python line definition
But then I get this error :
src/wrappers/export_vertex.cpp|418| error: overloaded function with no
contextual type information
The problem is: 1, I don't understand what I do wrong, and 2, it used to
work.
Pierre
- [g++-4.1] Strange problem with overloading,
Pierre Barbier de Reuille <=