Replace GCC-specific attribute with [[nodiscard]] attribute (#6899)

This commit is contained in:
Dennis Luxen
2024-05-24 20:34:04 +02:00
committed by GitHub
parent 21607e0cb2
commit babdced52f
20 changed files with 98 additions and 157 deletions
+1
View File
@@ -5,6 +5,7 @@
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <random>
#include <string>
+2 -4
View File
@@ -433,8 +433,7 @@ void suppressStep(RouteStep &step_at_turn_location, RouteStep &step_after_turn_l
}
// OTHER IMPLEMENTATIONS
OSRM_ATTR_WARN_UNUSED
RouteSteps collapseTurnInstructions(RouteSteps steps)
[[nodiscard]] RouteSteps collapseTurnInstructions(RouteSteps steps)
{
// make sure we can safely iterate over all steps (has depart/arrive with TurnType::NoTurn)
BOOST_ASSERT(!hasTurnType(steps.front()) && !hasTurnType(steps.back()));
@@ -589,8 +588,7 @@ RouteSteps collapseTurnInstructions(RouteSteps steps)
}
// OTHER IMPLEMENTATIONS
OSRM_ATTR_WARN_UNUSED
RouteSteps collapseSegregatedTurnInstructions(RouteSteps steps)
[[nodiscard]] RouteSteps collapseSegregatedTurnInstructions(RouteSteps steps)
{
// make sure we can safely iterate over all steps (has depart/arrive with TurnType::NoTurn)
BOOST_ASSERT(!hasTurnType(steps.front()) && !hasTurnType(steps.back()));