Calling lua functions from C++ with luabind?

Started by
12 comments, last by CodaKiller 14 years, 11 months ago
Looks like you never define operator==.

[size=1]Visit my website, rawrrawr.com

Advertisement
Quote:Original post by bobofjoe
Looks like you never define operator==.


I don't understand, can you clarify your statement please? I've never heard of operator until today and I have no idea what I need to do.

I thought you may be talking about the std operators so I tried this:
	bool std::operator==(E_WINDOW);


But it returns the same error as the luabind operators:

Quote:
1>.\Main.cpp(966) : error C2838: '==' : illegal qualified name in member declaration
Remember Codeka is my alternate account, just remember that!
You need to define how the operator works in the context of your class, eg:
class MyClass{    int x;public:    MyClass(int _x):x(_x){}    bool operator ==(const MyClass&rhs)    {        return x == rhs.x;    }};int main(){    MyClass a(5), b(10), c(5);    a == a;//true    a == b;//false    a == c;//true    b == c;//false};
Quote:Original post by Fire Lancer
You need to define how the operator works in the context of your class, eg:
*** Source Snippet Removed ***


Yay!!! It works! Thanks guys!
Remember Codeka is my alternate account, just remember that!

This topic is closed to new replies.

Advertisement