Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9223: Alllow find(key) with key's type different from the contained value type.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-10-10 12:09:28
#9223: Alllow find(key) with key's type different from the contained value type.
-------------------------------+------------------------
Reporter: mjklaim@⦠| Owner: igaztanaga
Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: container
Version: Boost 1.54.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+------------------------
Comment (by mjklaim@â¦):
As you will see in the example attached (tests uses Google Test) the call
to find allow different types of keys than the underlying value type, as
expressed in the "unique_key_values" test.
Unfortunately I had to write a custom "find" function in the
AnyValueSet::SetOf class, so that the key is used to compare directly with
the value, both types being preserved.
Fortunately, flat_set being basically a vector, it's not really a problem
on performance to write the search this way.
Anyway, I wanted to give my use case. The find function could be
simplified by just providing the key to flat_set instead of having to do
the search manually.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9223#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC