Warren Young wrote:
> Warren Young wrote:
>> On Jan 29, 2009, at 7:29 AM, Edward Diener wrote:
>>
>>> I think that mysqlpp::tiny_int needs an == operator.
>>
>> Try it.
>
> Have you tried it yet? If it worked, I'd like to add it to 3.0.9,
> assuming it doesn't break anything.
>
I added to tiny_int.h:
bool operator ==(const this_type& i) const
{
return value_ == i.value_;
}
bool operator !=(const this_type& i) const
{
return value_ != i.value_;
}
bool operator <(const this_type& i) const
{
return value_ < i.value_;
}
bool operator >(const this_type& i) const
{
return value_ > i.value_;
}
bool operator <=(const this_type& i) const
{
return value_ <= i.value_;
}
bool operator >=(const this_type& i) const
{
return value_ >= i.value_;
}
It has compiled with no problems and my code works correctly when using
my OP example.
I realize that !=, >, <=, and >= can all be coded in terms of == and <
but I do not think it is wrong to assume that this_type supports each of
them individually, as all native integer types do.