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

Unified Diff: third_party/re2/util/util.h

Issue 548083002: re2: Merge upstream 2225f94df8ec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 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
Index: third_party/re2/util/util.h
diff --git a/third_party/re2/util/util.h b/third_party/re2/util/util.h
index 49159c2e446768c75ba6f43599491a999e58f026..83504454b28c40c38dd8c4ac79f8d1782697904a 100644
--- a/third_party/re2/util/util.h
+++ b/third_party/re2/util/util.h
@@ -79,9 +79,13 @@ typedef unsigned int uint;
typedef unsigned short ushort;
// COMPILE_ASSERT causes a compile error about msg if expr is not true.
+#if __cplusplus >= 201103L
+#define COMPILE_ASSERT(expr, msg) static_assert(expr, #msg)
+#else
template<bool> struct CompileAssert {};
#define COMPILE_ASSERT(expr, msg) \
typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
+#endif
// DISALLOW_EVIL_CONSTRUCTORS disallows the copy and operator= functions.
// It goes in the private: declarations in a class.
« third_party/re2/lib/codereview/codereview.py ('K') | « third_party/re2/lib/codereview/codereview.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698