Commit 708ba318 authored by brucedawson's avatar brucedawson Committed by Commit bot

Mark operator() as const for VS 2015 compat.

VS 2015 RC says, when compiling device_monitor_win.cpp:
error C3848: expression having type 'const device::`anonymous-namespace'
::CompareGUID' would lose some const-volatile qualifiers in order to
call 'bool device::`anonymous-namespace'::CompareGUID::operator
()(const GUID &,const GUID &)'

For details see the STL Breaking Changes (VS14 CTP1) section of:
http://blogs.msdn.com/b/vcblog/archive/2014/06/06/
c-14-stl-features-fixes-and-breaking-changes-in-
visual-studio-14-ctp1.aspx

The complaint, apparently, is that operator() is non-const. Whether this
is actually invalid is for the language lawyers to decide. Marking it
const is more accurate anyway.

R=reillyg@chromium.org
BUG=440500

Review URL: https://codereview.chromium.org/1064153002

Cr-Commit-Position: refs/heads/master@{#324129}
parent f072931f
...@@ -26,7 +26,7 @@ DeviceMonitorMessageWindow* g_message_window; ...@@ -26,7 +26,7 @@ DeviceMonitorMessageWindow* g_message_window;
// Provides basic comparability for GUIDs so that they can be used as keys to an // Provides basic comparability for GUIDs so that they can be used as keys to an
// STL map. // STL map.
struct CompareGUID { struct CompareGUID {
bool operator()(const GUID& a, const GUID& b) { bool operator()(const GUID& a, const GUID& b) const {
return memcmp(&a, &b, sizeof a) < 0; return memcmp(&a, &b, sizeof a) < 0;
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment