serge1 / ELFIO

ELFIO - ELF (Executable and Linkable Format) reader and producer implemented as a header only C++ library
http://serge1.github.io/ELFIO
MIT License
726 stars 157 forks source link

Fix a warning shown up with clang++: -Wall -Werror -Wextra #130

Closed cjatin closed 8 months ago

cjatin commented 9 months ago
elfio/elfio_modinfo.hpp:62:26: warning: loop variable '[first, second]' creates a copy from type 'std::pair<std::basic_string<char>, std::basic_string<char>> const' [-Wrange-loop-construct]
   62 |         for ( const auto [first, second] : content ) {
      |                          ^
elfio/elfio_modinfo.hpp:62:15: note: use reference type 'std::pair<std::basic_string<char>, std::basic_string<char>> const &' to prevent copying
   62 |         for ( const auto [first, second] : content ) {
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                          &
1 warning generated.
serge1 commented 8 months ago

Accepted. Thank you!