Original Post
Hi all, I have a class called GFizik. This has some members and one of'em is a vector type array:
typedef std::vector<NxActor*> ActorVec;
...
class GFizik
{
public:
...
HRESULT AddActor (NxActorDesc Desc);
NxActor* RigidBody (LPCSTR name);
NxActor* RigidBody (const UINT index);
...
ActorVec pActors;
}; With AddActor(), I'm adding an NxActor* element to pActors vector array by using vector's push_back() function. And with RigidBody() functions, I'm getting an element of pActors array by its name or index. For example, to access by index: NxActor* GFizik::RigidBody(const UINT index)
{
if (index < 0 || index > pActors.size()) return NULL;
return pActors [index];
} My app has a GFizik type member (m_Physics). If I write somewhere in my code, m_Physics.RigidBody(0)->SetGlobalPose (...) then my compiler gives me an error: ... error C2668: 'GFizik::RigidBody' : ambiguous call to overloaded function ... could be 'NxActor *GFizik::RigidBody(LPCSTR)' ... or 'NxActor *GFizik::RigidBody(const UINT)' But if I write UINT ind = 0; m_Physics.RigidBody(ind)->SetGlobalPose (...); no error occurs. Also if I'm using RigidBody() function like; m_Physics.RigidBody ("plane1")->SetGlobalPose(...) no error occurs again. How can I solve my problem? Thanks in advance.