Skip to content

Commit

Permalink
Add static cast to step direction to silence compiler warning when co…
Browse files Browse the repository at this point in the history
…mpiling c++ 20 (#375)

Add static cast to step direction to silence compiler warning when compiling c++ 20
  • Loading branch information
niermann999 authored Jan 24, 2023
1 parent e2febfb commit c1b6f0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/include/detray/propagator/constrained_step.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ struct constrained_step {
DETRAY_HOST_DEVICE scalar
size(const step::direction dir = step::direction::e_forward) const {
if constexpr (type == step::constraint::e_all) {
return dir * min();
return static_cast<scalar>(dir) * min();
} else {
return dir * _constraints[type];
return static_cast<scalar>(dir) * _constraints[type];
}
}

Expand Down

0 comments on commit c1b6f0d

Please sign in to comment.