Revert "Use explicitly sized std::array instead of C array and ptr arithmetic"
This reverts commit 24321657ee.
This commit is contained in:
parent
24321657ee
commit
e4c017533c
@ -154,21 +154,24 @@ inline bool operator==(const TurnInstruction lhs, const TurnInstruction rhs)
|
|||||||
inline bool hasRoundaboutType(const TurnInstruction instruction)
|
inline bool hasRoundaboutType(const TurnInstruction instruction)
|
||||||
{
|
{
|
||||||
using namespace guidance::TurnType;
|
using namespace guidance::TurnType;
|
||||||
const constexpr std::array<TurnType::Enum, 13> valid_types = {TurnType::EnterRoundabout,
|
const constexpr TurnType::Enum valid_types[] = {TurnType::EnterRoundabout,
|
||||||
TurnType::EnterAndExitRoundabout,
|
TurnType::EnterAndExitRoundabout,
|
||||||
TurnType::EnterRotary,
|
TurnType::EnterRotary,
|
||||||
TurnType::EnterAndExitRotary,
|
TurnType::EnterAndExitRotary,
|
||||||
TurnType::EnterRoundaboutIntersection,
|
TurnType::EnterRoundaboutIntersection,
|
||||||
TurnType::EnterAndExitRoundaboutIntersection,
|
TurnType::EnterAndExitRoundaboutIntersection,
|
||||||
TurnType::EnterRoundaboutAtExit,
|
TurnType::EnterRoundaboutAtExit,
|
||||||
TurnType::ExitRoundabout,
|
TurnType::ExitRoundabout,
|
||||||
TurnType::EnterRotaryAtExit,
|
TurnType::EnterRotaryAtExit,
|
||||||
TurnType::ExitRotary,
|
TurnType::ExitRotary,
|
||||||
TurnType::EnterRoundaboutIntersectionAtExit,
|
TurnType::EnterRoundaboutIntersectionAtExit,
|
||||||
TurnType::ExitRoundaboutIntersection,
|
TurnType::ExitRoundaboutIntersection,
|
||||||
TurnType::StayOnRoundabout};
|
TurnType::StayOnRoundabout};
|
||||||
|
|
||||||
return std::find(valid_types.cbegin(), valid_types.cend(), instruction.type);
|
const auto *first = valid_types;
|
||||||
|
const auto *last = first + sizeof(valid_types) / sizeof(valid_types[0]);
|
||||||
|
|
||||||
|
return std::find(first, last, instruction.type) != last;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool entersRoundabout(const guidance::TurnInstruction instruction)
|
inline bool entersRoundabout(const guidance::TurnInstruction instruction)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user