Minollo wrote:
Quote:
i have a problem with Berkeley DB. I try to set
db_.set_bt_compare(compare_int) |
If you define the compare function inside a c++ class it needs to be a
static function.
So the method signature in MyDb.hpp should be something like:
static int compare_long(Db *dbp, const Dbt *a, const Dbt *b);
The call will be:
db_.set_bt_compare(MyDb::compare_long);
The implementation will be:
int MyDb::compare_long(Db *dbp, const Dbt *a, const Dbt *b)
{
// code here.
return 0;
}
Regards,
Alex