summaryrefslogtreecommitdiff
path: root/src/location.hh
blob: ce4984e6e167f4610143b34efaba054aa157fa69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef LOCATION_HH
#define LOCATION_HH

#include <limits>
#include <math.h>

struct Location {
  double lat;
  double lng;

  Location(double lat, double lng)
    : lat(lat), lng(lng) {}

  Location()
    : lat(std::numeric_limits<double>::quiet_NaN()),
      lng(std::numeric_limits<double>::quiet_NaN()) {}

  bool empty() const {
    return std::isnan(lat) || std::isnan(lng);
  }
};

#endif  // LOCATION_HH