H
Henrik Goldman
Hi,
I'd like to use std::set to get a uniqueness between a set of (unsigned char
*) with fixed known lengths.
So I thought I would write my own class which holds this:
class CUnique
{
public:
unsigned char m_sHash[FIXED_SIZE];
bool operator()(CUnique &Lhs, CUnique &Rhs) const
{
return memcmp(Lhs.m_sHash, Rhs.m_sHash, FIXED_SIZE) != 0;
}
};
The problem however is that std::set doesn't seem to pickup my compare
function. I'm not sure if it's correctly written either but it's best guess
from the sparse examples I found on the net.
Can someone help me on getting the compare function right and thus fix the
compilation problems?
Thanks in advance.
-- Henrik
I'd like to use std::set to get a uniqueness between a set of (unsigned char
*) with fixed known lengths.
So I thought I would write my own class which holds this:
class CUnique
{
public:
unsigned char m_sHash[FIXED_SIZE];
bool operator()(CUnique &Lhs, CUnique &Rhs) const
{
return memcmp(Lhs.m_sHash, Rhs.m_sHash, FIXED_SIZE) != 0;
}
};
The problem however is that std::set doesn't seem to pickup my compare
function. I'm not sure if it's correctly written either but it's best guess
from the sparse examples I found on the net.
Can someone help me on getting the compare function right and thus fix the
compilation problems?
Thanks in advance.
-- Henrik