Boost logo

Boost Users :

Subject: Re: [Boost-users] bimap find
From: Matias Capeletto (matias.capeletto_at_[hidden])
Date: 2009-12-14 09:36:40


Hello,

On Sun, Dec 13, 2009 at 9:23 AM, Bosko Markovic <boskoma_at_[hidden]> wrote:
> When searching bimap using find method what is the value of returned
> iterator if nothing matches search query?

> Example code:
> BimapDWORDVariant::right_map::const_iterator right_iter =
> bm.right.find(sSyncMsg);

bm.right mimics a std::map, and this includes the way find works. If
finds fails it will return bm.right.end(). It will become clear if you
look at this code:

BimapDWORDVariant::right_map & rmap = bm.right;
if( rmap.find(sSyncMsg) == rmap.end() ) { ... }

Best regards
Matias


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net