Explicitly instantiate PropagatingEitherWay::send<> templates (#246)

Otherwise compiler was optimizing (inlining) them away.
This commit is contained in:
Michael Görner 2021-03-23 11:37:30 +01:00 committed by GitHub
parent f59e5170fb
commit f2958a4a0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -578,6 +578,11 @@ template <Interface::Direction dir>
void PropagatingEitherWay::send(const InterfaceState& start, InterfaceState&& end, SubTrajectory&& trajectory) {
pimpl()->send<dir>(start, std::move(end), std::make_shared<SubTrajectory>(std::move(trajectory)));
}
// Explicit template instantiation is required. The compiler, otherwise, might just inline them.
template void PropagatingEitherWay::send<Interface::FORWARD>(const InterfaceState& start, InterfaceState&& end,
SubTrajectory&& trajectory);
template void PropagatingEitherWay::send<Interface::BACKWARD>(const InterfaceState& start, InterfaceState&& end,
SubTrajectory&& trajectory);
template <Interface::Direction dir>
void PropagatingEitherWay::computeGeneric(const InterfaceState& start) {