From 98721c85431d223c895a25d63dafb9e6637d34c4 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Sat, 20 Mar 2021 15:42:35 +0100 Subject: BLI: improve support for generic algorithms with c++ containers Some generic algorithms from the standard library like `std::any_of` did not work with all container and iterator types. To improve the situation, this patch adds various type members to containers and iterators. Custom iterators for Set, Map and IndexRange now have an iterator category, which soe algorithms require. IndexRange could become a random access iterator, but adding all the missing methods can be done when it is necessary. --- source/blender/blenlib/BLI_multi_value_map.hh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/blenlib/BLI_multi_value_map.hh') diff --git a/source/blender/blenlib/BLI_multi_value_map.hh b/source/blender/blenlib/BLI_multi_value_map.hh index 4113085a1e3..98b55067a5c 100644 --- a/source/blender/blenlib/BLI_multi_value_map.hh +++ b/source/blender/blenlib/BLI_multi_value_map.hh @@ -38,6 +38,9 @@ namespace blender { template class MultiValueMap { + public: + using size_type = int64_t; + private: using MapType = Map>; MapType map_; -- cgit v1.2.3