stijnfrishert / libLSDJ

Library for working with the LSDj save file format
MIT License
91 stars 6 forks source link

fix: add #include <algorithm> #106

Closed sdomi closed 4 months ago

sdomi commented 4 months ago

compiling on Alpine Linux, I hit the following error:

[18/47] Building CXX object liblsdj/test/CMakeFiles/test.dir/main.cpp.o
ninja: job failed: /usr/bin/c++  -I/home/domi/projects/libLSDJ/dependency -I/home/domi/projects/libLSDJ/liblsdj/include -std=gnu++20 -MD -MT lsdsng_export/CMakeFiles/lsdsng-export.dir/exporter.cpp.o -MF lsdsng_export/CMakeFiles/lsdsng-export.dir/exporter.cpp.o.d -o lsdsng_export/CMakeFiles/lsdsng-export.dir/exporter.cpp.o -c /home/domi/projects/libLSDJ/lsdsng_export/exporter.cpp
/home/domi/projects/libLSDJ/lsdsng_export/exporter.cpp: In member function 'int lsdj::Exporter::exportSav(const std::filesystem::__cxx11::path&)':
/home/domi/projects/libLSDJ/lsdsng_export/exporter.cpp:110:38: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
  110 |     if (!indices.empty() && std::find(std::begin(indices), std::end(indices),
      |                             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  111 |                                       i) == std::end(indices))
      |                                       ~~

cmake invoked with cmake -Bbuild -Gninja; build invoked with ninja. Not unlikely that it wasn't visible with classic make.

stijnfrishert commented 4 months ago

Thank you for your contribution @sdomi! Just merged it in, hope everything builds for you now :)