Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Unified Diff: mojo/edk/system/ipc_support.cc

Issue 1350953003: Use std::is_same to check for identical types. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/ipc_support.cc
diff --git a/mojo/edk/system/ipc_support.cc b/mojo/edk/system/ipc_support.cc
index 1c4b232c1d33c2da66e092d68b12b559af9e7f78..af142818f217c2aba404c77f669784cf2e16c70c 100644
--- a/mojo/edk/system/ipc_support.cc
+++ b/mojo/edk/system/ipc_support.cc
@@ -4,6 +4,8 @@
#include "mojo/edk/system/ipc_support.h"
+#include <type_traits>
+
#include "base/logging.h"
#include "mojo/edk/embedder/master_process_delegate.h"
#include "mojo/edk/embedder/slave_process_delegate.h"
@@ -96,8 +98,7 @@ scoped_refptr<system::MessagePipeDispatcher> IPCSupport::ConnectToSlave(
DCHECK(channel_id);
// We rely on |ChannelId| and |ProcessIdentifier| being identical types.
- // TODO(vtl): Use std::is_same instead when we are allowed to (C++11 library).
- static_assert(sizeof(ChannelId) == sizeof(ProcessIdentifier),
+ static_assert(std::is_same<ChannelId, ProcessIdentifier>::value,
"ChannelId and ProcessIdentifier types don't match");
embedder::ScopedPlatformHandle platform_connection_handle =
@@ -115,8 +116,7 @@ scoped_refptr<system::MessagePipeDispatcher> IPCSupport::ConnectToMaster(
ChannelId* channel_id) {
DCHECK(channel_id);
- // TODO(vtl): Use std::is_same instead when we are allowed to (C++11 library).
- static_assert(sizeof(ChannelId) == sizeof(ProcessIdentifier),
+ static_assert(std::is_same<ChannelId, ProcessIdentifier>::value,
"ChannelId and ProcessIdentifier types don't match");
embedder::ScopedPlatformHandle platform_connection_handle =
ConnectToMasterInternal(connection_id);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698