Hello dear fellas,
I have this declaration in a header:
class Comparator
{
public:
inline bool operator () (const SGEEmotion& left, const SGEEmotion& right) const;
};
And an implementation in a .cpp file. Oddly enough, this gives me an unresolved external for this method.
However, if I don't mark it as inline everything is fine... Does this mean it can't be inline? Does this apply to all operators? It doesn't make much sense...
Thanks in advance.
PS: I'm using VS08!
Update:
Ok, now I'm really confused! This works:
class SGEAction
{
friend class SGEActionFactory;
public:
class Comparator
{
public:
inline bool operator () (const SGEAction& left, const SGEAction& right) const;
};
};
This doesn't:
class SGEEmotion
{
public:
class Comparator
{
public:
inline bool operator () (const SGEEmotion& left, const SGEEmotion& right) const;
};
};
Didn't think the implementation was important... I don't know anymore:
bool SGEAction::Comparator::operator () (const SGEAction& left, const SGEAction& right) const
{ return left.id() < right.id(); }
bool SGEEmotion::Comparator::operator () (const SGEEmotion& left, const SGEEmotion& right) const
{ return left.id() < right.id(); }
Don't get it...