Skip to content

Commit

Permalink
fix: #include <algorithm> in HoughTransformUtils for std::sort (#…
Browse files Browse the repository at this point in the history
…3758)

With gcc-14, the following compilation failure is reported:
```
     438    In file included from /home/wdconinc/git/acts/Core/include/Acts/Seeding/HoughTransformUtils.hpp:374,
     439                     from /home/wdconinc/git/acts/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/MuonHoughSeeder.hpp:12,
     440                     from /home/wdconinc/git/acts/Examples/Algorithms/TrackFinding/src/MuonHoughSeeder.cpp:9:
     441    /home/wdconinc/git/acts/Core/include/Acts/Seeding/HoughTransformUtils.ipp: In member function 'std::vector<Acts::HoughTransformUtils::PeakFinders::IslandsAroundMax<identifier_t>::Maximum> Acts::HoughTransformUtils::PeakFind
            ers::IslandsAroundMax<identifier_t>::findPeaks(const Acts::HoughTransformUtils::HoughPlane<identifier_t>&, const Acts::HoughTransformUtils::HoughAxisRanges&)':
  >> 442    /home/wdconinc/git/acts/Core/include/Acts/Seeding/HoughTransformUtils.ipp:224:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
     443      224 |   std::sort(candidates.begin(), candidates.end(),
     444          |        ^~~~
     445          |        qsort
  >> 446    make[2]: *** [Examples/Algorithms/TrackFinding/CMakeFiles/ActsExamplesTrackFinding.dir/build.make:177: Examples/Algorithms/TrackFinding/CMakeFiles/ActsExamplesTrackFinding.dir/src/MuonHoughSeeder.cpp.o] Error 1
     447    make[2]: *** Waiting for unfinished jobs....
```
This appears to be due to a missing `#include <algorithm>` before the use of `std::sort` in the `.ipp` file. This PR adds the `algorithm` header to the `.hpp` file.
  • Loading branch information
wdconinc authored Oct 18, 2024
1 parent 1d1ccbd commit 8925fb5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Core/include/Acts/Seeding/HoughTransformUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "Acts/Utilities/Logger.hpp"
#include "Acts/Utilities/Result.hpp"

#include <algorithm>
#include <array>
#include <map>
#include <optional>
Expand Down

0 comments on commit 8925fb5

Please sign in to comment.