Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated std::is_pod #6717

Merged
merged 2 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions include/util/coordinate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,20 @@ using FloatLongitude = Alias<double, tag::longitude>;
// range checks on these (toFixed/toFloat, etc)
using UnsafeFloatLatitude = Alias<double, tag::unsafelatitude>;
using UnsafeFloatLongitude = Alias<double, tag::unsafelongitude>;
static_assert(std::is_pod<FixedLatitude>(), "FixedLatitude is not a valid alias");
static_assert(std::is_pod<FixedLongitude>(), "FixedLongitude is not a valid alias");
static_assert(std::is_pod<FloatLatitude>(), "FloatLatitude is not a valid alias");
static_assert(std::is_pod<FloatLongitude>(), "FloatLongitude is not a valid alias");
static_assert(std::is_pod<UnsafeFloatLatitude>(), "UnsafeFloatLatitude is not a valid alias");
static_assert(std::is_pod<UnsafeFloatLongitude>(), "UnsafeFloatLongitude is not a valid alias");
static_assert(std::is_standard_layout<FixedLatitude>() && std::is_trivial<FixedLatitude>(),
"FixedLatitude is not a valid alias");
static_assert(std::is_standard_layout<FixedLongitude>() && std::is_trivial<FixedLongitude>(),
"FixedLongitude is not a valid alias");
static_assert(std::is_standard_layout<FloatLatitude>() && std::is_trivial<FloatLatitude>(),
"FloatLatitude is not a valid alias");
static_assert(std::is_standard_layout<FloatLongitude>() && std::is_trivial<FloatLongitude>(),
"FloatLongitude is not a valid alias");
static_assert(std::is_standard_layout<UnsafeFloatLatitude>() &&
std::is_trivial<UnsafeFloatLatitude>(),
"UnsafeFloatLatitude is not a valid alias");
static_assert(std::is_standard_layout<UnsafeFloatLongitude>() &&
std::is_trivial<UnsafeFloatLongitude>(),
"UnsafeFloatLongitude is not a valid alias");

/**
* Converts a typed latitude from floating to fixed representation.
Expand Down
3 changes: 2 additions & 1 deletion include/util/fingerprint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ struct FingerPrint

static_assert(sizeof(FingerPrint) == 8, "FingerPrint has unexpected size");
static_assert(std::is_trivial<FingerPrint>::value, "FingerPrint needs to be trivial.");
static_assert(std::is_pod<FingerPrint>::value, "FingerPrint needs to be a POD.");
static_assert(std::is_standard_layout<FingerPrint>::value,
"FingerPrint needs have a standard layout.");
} // namespace osrm::util

#endif /* FingerPrint_H */
6 changes: 4 additions & 2 deletions include/util/typedefs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ struct turn_penalty
using OSMNodeID = osrm::Alias<std::uint64_t, tag::osm_node_id>;
// clang-tidy fires `bugprone-throw-keyword-missing` here for unknown reason
// NOLINTNEXTLINE(bugprone-throw-keyword-missing)
static_assert(std::is_pod<OSMNodeID>(), "OSMNodeID is not a valid alias");
static_assert(std::is_standard_layout<OSMNodeID>() && std::is_trivial<OSMNodeID>(),
"OSMNodeID is not a valid alias");
using OSMWayID = osrm::Alias<std::uint64_t, tag::osm_way_id>;
// NOLINTNEXTLINE(bugprone-throw-keyword-missing)
static_assert(std::is_pod<OSMWayID>(), "OSMWayID is not a valid alias");
static_assert(std::is_standard_layout<OSMWayID>() && std::is_trivial<OSMWayID>(),
"OSMWayID is not a valid alias");

using DuplicatedNodeID = std::uint64_t;
using RestrictionID = std::uint64_t;
Expand Down
Loading