Skip to content

Commit f2958a4

Browse files
authored
Explicitly instantiate PropagatingEitherWay::send<> templates (#246)
Otherwise compiler was optimizing (inlining) them away.
1 parent f59e517 commit f2958a4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/src/stage.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,11 @@ template <Interface::Direction dir>
578578
void PropagatingEitherWay::send(const InterfaceState& start, InterfaceState&& end, SubTrajectory&& trajectory) {
579579
pimpl()->send<dir>(start, std::move(end), std::make_shared<SubTrajectory>(std::move(trajectory)));
580580
}
581+
// Explicit template instantiation is required. The compiler, otherwise, might just inline them.
582+
template void PropagatingEitherWay::send<Interface::FORWARD>(const InterfaceState& start, InterfaceState&& end,
583+
SubTrajectory&& trajectory);
584+
template void PropagatingEitherWay::send<Interface::BACKWARD>(const InterfaceState& start, InterfaceState&& end,
585+
SubTrajectory&& trajectory);
581586

582587
template <Interface::Direction dir>
583588
void PropagatingEitherWay::computeGeneric(const InterfaceState& start) {

0 commit comments

Comments
 (0)