diff options
author | brucedawson <brucedawson@chromium.org> | 2015-04-07 14:52:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-07 21:53:04 +0000 |
commit | 708ba318c48d27b840274b004ab4ba532e8b8924 (patch) | |
tree | b323e68d5331d2a34cf2a7339980329db053b845 /device | |
parent | f072931f978d65c159fa043bf6d2092c25b57724 (diff) | |
download | chromium_src-708ba318c48d27b840274b004ab4ba532e8b8924.zip chromium_src-708ba318c48d27b840274b004ab4ba532e8b8924.tar.gz chromium_src-708ba318c48d27b840274b004ab4ba532e8b8924.tar.bz2 |
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}
Diffstat (limited to 'device')
-rw-r--r-- | device/core/device_monitor_win.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/device/core/device_monitor_win.cc b/device/core/device_monitor_win.cc index cf2d1f7..3449c82 100644 --- a/device/core/device_monitor_win.cc +++ b/device/core/device_monitor_win.cc @@ -26,7 +26,7 @@ DeviceMonitorMessageWindow* g_message_window; // Provides basic comparability for GUIDs so that they can be used as keys to an // STL map. 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; } }; |