Skip to content

Commit

Permalink
fix: BinUtility was auto-convertible from Transform3 (#3691)
Browse files Browse the repository at this point in the history
This was visible when trying to do

```cpp
std::cout << Transform3{};
```

which would invoke BinUtility's output stream operator, because that wasn't a hidden `friend`, and BinUtility was auto-convertible.
  • Loading branch information
paulgessinger authored Oct 4, 2024
1 parent 68cf91d commit 5c5d085
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
10 changes: 6 additions & 4 deletions Core/include/Acts/Utilities/BinUtility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class BinUtility {
/// Constructor with only a Transform3
///
/// @param tForm is the local to global transform
BinUtility(const Transform3& tForm)
explicit BinUtility(const Transform3& tForm)
: m_binningData(), m_transform(tForm), m_itransform(tForm.inverse()) {
m_binningData.reserve(3);
}
Expand Down Expand Up @@ -317,13 +317,15 @@ class BinUtility {
return ss.str();
}

/// Overload of << operator for std::ostream for debug output
friend std::ostream& operator<<(std::ostream& sl, const BinUtility& bgen) {
return bgen.toStream(sl);
}

private:
std::vector<BinningData> m_binningData; /// vector of BinningData
Transform3 m_transform; /// shared transform
Transform3 m_itransform; /// unique inverse transform
};

/// Overload of << operator for std::ostream for debug output
std::ostream& operator<<(std::ostream& sl, const BinUtility& bgen);

} // namespace Acts
15 changes: 0 additions & 15 deletions Core/src/Utilities/BinUtility.cpp

This file was deleted.

1 change: 0 additions & 1 deletion Core/src/Utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ target_sources(
ActsCore
PRIVATE
AnnealingUtility.cpp
BinUtility.cpp
Logger.cpp
SpacePointUtility.cpp
TrackHelpers.cpp
Expand Down

0 comments on commit 5c5d085

Please sign in to comment.