+2020-08-02 Bruno Haible <bruno@clisp.org>
+
+ oset-c++, omap-c++: Remove restriction for search_atleast method.
+ * lib/gl_oset.hh (gl_OSet::search_atleast): Allow the threshold to be of
+ a different type than the element.
+ * lib/gl_omap.hh (gl_OMap::search_atleast): Allow the threshold to be of
+ a different type than the key.
+
2020-08-01 Paul Eggert <eggert@cs.ucla.edu>
gnumakefile: say ‘$(MAKE)’ not ‘make’
THRESHOLD is defined by the THRESHOLD_FN.
Returns true and stores the found pair in KEY and VALUE if found.
Otherwise returns false. */
- bool search_atleast (bool (*threshold_fn) (KEYTYPE * /*key*/, KEYTYPE * /*threshold*/),
- KEYTYPE * threshold,
+ template <typename THT>
+ bool search_atleast (bool (*threshold_fn) (KEYTYPE * /*key*/, THT * /*threshold*/),
+ THT * threshold,
KEYTYPE *& key, VALUETYPE *& value) const
{ return gl_omap_search_atleast (_ptr, reinterpret_cast<gl_mapkey_threshold_fn>(threshold_fn), threshold, &key, &value); }
by the THRESHOLD_FN.
Returns true and store the found element in ELT if found, otherwise returns
false. */
- bool search_atleast (bool (*threshold_fn) (ELTYPE * /*elt*/, ELTYPE * /*threshold*/),
- ELTYPE * threshold,
+ template <typename THT>
+ bool search_atleast (bool (*threshold_fn) (ELTYPE * /*elt*/, THT * /*threshold*/),
+ THT * threshold,
ELTYPE *& elt) const
{ return gl_oset_search_atleast (_ptr, reinterpret_cast<gl_setelement_threshold_fn>(threshold_fn), threshold, &elt); }