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:
zeliard 2015-05-04 18:03:49 +09:00
parent 7665cf3dde
commit cc9d603200
1 changed files with 5 additions and 5 deletions

View File

@ -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 &&