Problem Overloading Function

Phlox Icon <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
I've successfully bound an overloaded function before but this one is giving
errors.
It's of the CAI_BaseNPC class. The function I'm trying to bind is the top
one here.
CAI_Motor * GetMotor() { return m_pMotor; }
const CAI_Motor * GetMotor() const { return m_pMotor; }

I thought maybe it was because of missing includes or something so I put
them in. Here's the code that generates the error.
#include "ai_basenpc.h"
#include "ai_motor.h"
class CAI_Motor;
....
.def( "KeyValue", (bool(CBaseEntity::*)(const char*, const char*))
&CBaseEntity::KeyValue ) // overloaded fine
.def( "GetMotor", (CAI_Motor( CAI_BaseNPC::* )(void)) &CAI_BaseNPC::GetMotor
) // generates error

There are quite a few erro messages but they're all pretty much the same
after the second one.. These are the first two.
error C2440: 'type cast' : cannot convert from 'overloaded-function' to
'CAI_Motor (__thiscall CAI_BaseNPC::* )(void)'
1>        None of the functions with this name in scope match the target
type
1>.\lua_luahandle.cpp(171) : error C2780: 'luabind::class_<T>
&luabind::class_<T>::def(luabind::detail::operator_<Derived>)' : expects 1
arguments - 2 provided
1>        with
1>        [
1>            T=CAI_BaseNPC
1>        ]
1>        c:\HL2AITools02\src\lua\luabind-0.8.1\luabind/class.hpp(1207) :
see declaration of 'luabind::class_<T>::def'
1>        with
1>        [
1>            T=CAI_BaseNPC
1>        ]

Any ideas? Thanks.

------------------------------------------------------------------------------

_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.