@@ -316,7 +316,7 @@ class Roaring64Map {
316316 }
317317 return std::accumulate (
318318 roarings.cbegin (), roarings.cend (), (uint64_t )0 ,
319- [](uint64_t previous, const std::pair<uint32_t , Roaring>& map_entry) {
319+ [](uint64_t previous, const std::pair<const uint32_t , Roaring>& map_entry) {
320320 return previous + map_entry.second .cardinality ();
321321 });
322322 }
@@ -326,7 +326,7 @@ class Roaring64Map {
326326 */
327327 bool isEmpty () const {
328328 return std::all_of (roarings.cbegin (), roarings.cend (),
329- [](const std::pair<uint32_t , Roaring>& map_entry) {
329+ [](const std::pair<const uint32_t , Roaring>& map_entry) {
330330 return map_entry.second .isEmpty ();
331331 });
332332 }
@@ -341,7 +341,7 @@ class Roaring64Map {
341341 // to avoid a clash with the Windows.h header under Windows
342342 return roarings.size () == ((size_t )(std::numeric_limits<uint32_t >::max)()) + 1
343343 ? std::all_of (roarings.cbegin (), roarings.cend (),
344- [](const std::pair<uint32_t , Roaring>& roaring_map_entry) {
344+ [](const std::pair<const uint32_t , Roaring>& roaring_map_entry) {
345345 // roarings within map are saturated if cardinality
346346 // is uint32_t max + 1
347347 return roaring_map_entry.second .cardinality () ==
@@ -384,7 +384,7 @@ class Roaring64Map {
384384 // Annoyingly, VS 2017 marks std::accumulate() as [[nodiscard]]
385385 (void )std::accumulate (
386386 roarings.cbegin (), roarings.cend (), ans,
387- [](uint64_t * previous, const std::pair<uint32_t , Roaring>& map_entry) {
387+ [](uint64_t * previous, const std::pair<const uint32_t , Roaring>& map_entry) {
388388 for (uint32_t low_bits : map_entry.second )
389389 *previous++ = uniteBytes (map_entry.first , low_bits);
390390 return previous;
@@ -527,7 +527,7 @@ class Roaring64Map {
527527 */
528528 void iterate(roaring_iterator64 iterator, void * ptr) const {
529529 std::for_each (roarings.begin (), roarings.cend (),
530- [=](const std::pair<uint32_t , Roaring>& map_entry) {
530+ [=](const std::pair<const uint32_t , Roaring>& map_entry) {
531531 roaring_iterate64 (&map_entry.second .roaring , iterator,
532532 uint64_t (map_entry.first ) << 32 , ptr);
533533 });
@@ -595,7 +595,7 @@ class Roaring64Map {
595595 // push map size
596596 buf = (char *)encode_varint64 ((uint8_t *)buf, roarings.size ());
597597 std::for_each (roarings.cbegin (), roarings.cend (),
598- [&buf](const std::pair<uint32_t , Roaring>& map_entry) {
598+ [&buf](const std::pair<const uint32_t , Roaring>& map_entry) {
599599 // push map key
600600 encode_fixed32_le ((uint8_t *)buf, map_entry.first );
601601 buf += sizeof (uint32_t );
@@ -657,7 +657,7 @@ class Roaring64Map {
657657 // start with type code, map size and size of keys for each map entry
658658 size_t init = 1 + varint_length (roarings.size ()) + roarings.size () * sizeof (uint32_t );
659659 return std::accumulate (roarings.cbegin (), roarings.cend (), init,
660- [=](size_t previous, const std::pair<uint32_t , Roaring>& map_entry) {
660+ [=](size_t previous, const std::pair<const uint32_t , Roaring>& map_entry) {
661661 // add in bytes used by each Roaring
662662 return previous + map_entry.second .getSizeInBytes ();
663663 });
@@ -731,7 +731,7 @@ class Roaring64Map {
731731 },
732732 (void *)&outer_iter_data);
733733 std::for_each (
734- ++map_iter, roarings.cend (), [](const std::pair<uint32_t , Roaring>& map_entry) {
734+ ++map_iter, roarings.cend (), [](const std::pair<const uint32_t , Roaring>& map_entry) {
735735 map_entry.second .iterate(
736736 [](uint32_t low_bits, void * high_bits) -> bool {
737737 std::printf (" ,%llu" , (long long unsigned )uniteBytes (
@@ -770,7 +770,7 @@ class Roaring64Map {
770770 (void *)&outer_iter_data);
771771 std::for_each (
772772 ++map_iter, roarings.cend (),
773- [&outer_iter_data](const std::pair<uint32_t , Roaring>& map_entry) {
773+ [&outer_iter_data](const std::pair<const uint32_t , Roaring>& map_entry) {
774774 outer_iter_data.high_bits = map_entry.first ;
775775 map_entry.second .iterate(
776776 [](uint32_t low_bits, void * inner_iter_data) -> bool {
0 commit comments