fix ambiguous namespace error on MSVC (examples::Rectangle)
fix std::min / std::max problem on MSVC (FYI: http://stackoverflow.com/questions/5004858/stdmin-gives-error)
This commit is contained in:
parent
7665cf3dde
commit
cc9d603200
|
|
@ -111,14 +111,14 @@ class RouteGuideImpl final : public RouteGuide::Service {
|
|||
return Status::OK;
|
||||
}
|
||||
|
||||
Status ListFeatures(ServerContext* context, const Rectangle* rectangle,
|
||||
Status ListFeatures(ServerContext* context, const examples::Rectangle* rectangle,
|
||||
ServerWriter<Feature>* writer) override {
|
||||
auto lo = rectangle->lo();
|
||||
auto hi = rectangle->hi();
|
||||
long left = std::min(lo.longitude(), hi.longitude());
|
||||
long right = std::max(lo.longitude(), hi.longitude());
|
||||
long top = std::max(lo.latitude(), hi.latitude());
|
||||
long bottom = std::min(lo.latitude(), hi.latitude());
|
||||
long left = (std::min)(lo.longitude(), hi.longitude());
|
||||
long right = (std::max)(lo.longitude(), hi.longitude());
|
||||
long top = (std::max)(lo.latitude(), hi.latitude());
|
||||
long bottom = (std::min)(lo.latitude(), hi.latitude());
|
||||
for (const Feature& f : feature_list_) {
|
||||
if (f.location().longitude() >= left &&
|
||||
f.location().longitude() <= right &&
|
||||
|
|
|
|||
Loading…
Reference in New Issue