Boost logo

Boost :

Subject: [boost] std::map::find() wrapper
From: Olaf van der Spek (ml_at_[hidden])
Date: 2011-04-20 09:54:50


I've written a small wrapper for std::map::find() (and map-like
containers/ranges) that returns a pointer to the value if found (or
NULL if not found).


The advantage is that you don't need the container type name (for
::reference), you can initialize the pointer inside an if condition,
you don't have to compare against ::end() and you don't have to use
For containers of pointers to objects, the wrapper could do an
additional dereference.

Do you think this would be useful for inclusion in Boost?



Boost list run by bdawes at, gregod at, cpdaniel at, john at