Skip to content

Commit

Permalink
Suggest that the hash functions be inline
Browse files Browse the repository at this point in the history
  • Loading branch information
eyal0 committed Jul 2, 2020
1 parent aec3629 commit f4f0c9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bg_operators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static std::ostream& operator<<(std::ostream& out, const vector<T>& xs) {

template <typename T>
struct hash<boost::geometry::model::d2::point_xy<T>> {
std::size_t operator()(const boost::geometry::model::d2::point_xy<T>& p) const {
inline std::size_t operator()(const boost::geometry::model::d2::point_xy<T>& p) const {
std::size_t seed = 0;
boost::hash_combine(seed, p.x());
boost::hash_combine(seed, p.y());
Expand All @@ -129,7 +129,7 @@ struct hash<boost::geometry::model::d2::point_xy<T>> {

template <typename T0, typename T1>
struct hash<std::pair<T0, T1>> {
std::size_t operator()(const std::pair<T0, T1>& x) const {
inline std::size_t operator()(const std::pair<T0, T1>& x) const {
std::size_t seed = 0;
boost::hash_combine(seed, hash<T0>{}(x.first));
boost::hash_combine(seed, hash<T1>{}(x.second));
Expand All @@ -139,7 +139,7 @@ struct hash<std::pair<T0, T1>> {

template <typename T>
struct hash<boost::geometry::model::linestring<T>> {
std::size_t operator()(const boost::geometry::model::linestring<T>& xs) const {
inline std::size_t operator()(const boost::geometry::model::linestring<T>& xs) const {
std::size_t seed = 0;
for (const auto& x : xs) {
boost::hash_combine(seed, hash<T>{}(x));
Expand Down

0 comments on commit f4f0c9c

Please sign in to comment.