I'm not quite sure whether the original code below is correct or not,
but it seems suspicious that compilation should succeed or fail
differently depending on whether the debug flags are in effect. I
thought the debug stuff was for catching runtime errors? If it is
wrong then shouldn't it also fail normally?
struct bncmp {
bool operator() (BIGNUM* lhs, BIGNUM* rhs) const
{return BN_cmp(lhs,rhs)<0;}
};
class DDB {
public:
map<BIGNUM*, BIGNUM*, bncmp> thedb;
...
}
map<BIGNUM*,BIGNUM*>::iterator it;
for (it = ddb.thedb.begin(); it != ddb.thedb.end(); ++it) {
---
error: no match for ‘operator!=’ in ‘it != std::__debug::map<_Key,
_Tp, _Compare, _Allocator>::end() [with _Key = BIGNUM*, _Tp = BIGNUM*,
_Compare = bncmp, _Allocator = std::allocator<std::pair<BIGNUM* const,
BIGNUM*> >]()’
make: *** [IARPA_DB/KO.o] Error 1
The type of 'thedb' here does not match ...
> ...
> }
> map<BIGNUM*,BIGNUM*>::iterator it;
... the type used for this iterator here.
I'd expect that to be
map<BIGNUM*, BIGNUM*, bncmp>::iterator it;
(and to make it easier to read, a typedef would help as well).
A bientot
Paul
--
Paul Floyd http://paulf.free.fr