diff --git a/src/nix-vector-routing/model/nix-vector-routing.cc b/src/nix-vector-routing/model/nix-vector-routing.cc index e6b5e7654..d451a09e3 100644 --- a/src/nix-vector-routing/model/nix-vector-routing.cc +++ b/src/nix-vector-routing/model/nix-vector-routing.cc @@ -34,17 +34,6 @@ #include "nix-vector-routing.h" -/* RunIf code is a candidate for ns-3 core module */ -template -void RunIf (std::true_type, F&& f, Ts&&... ts ) -{ - f (std::forward(ts)...); -} -template -void RunIf (std::false_type, Xs&&...) -{ -} - namespace ns3 { NS_LOG_COMPONENT_DEFINE ("NixVectorRouting"); @@ -417,19 +406,12 @@ NixVectorRouting::GetAdjacentNetDevices (Ptr netDevice, PtrGetAddress (j); - bool isNetDeviceAddrLinkLocal = false; - RunIf (std::is_same{}, [&](Ipv6InterfaceAddress IfAddr, bool &isNetDeviceAddrLinkLocal) + if constexpr (!IsIpv4::value) { - if (IfAddr.GetScope () == Ipv6InterfaceAddress::LINKLOCAL) + if (netDeviceIfAddr.GetScope () == Ipv6InterfaceAddress::LINKLOCAL) { - isNetDeviceAddrLinkLocal = true; + continue; } - }, - netDeviceIfAddr, isNetDeviceAddrLinkLocal); - - if (isNetDeviceAddrLinkLocal) - { - continue; } for (uint32_t k = 0; k < remoteDeviceAddresses; ++k) {