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

Unified Diff: mojo/edk/system/ports/name.h

Issue 2512753002: Move const PortName data out of header file (Closed)
Patch Set: Created 4 years, 1 month 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 | « mojo/edk/system/node_controller.cc ('k') | mojo/edk/system/ports/name.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/ports/name.h
diff --git a/mojo/edk/system/ports/name.h b/mojo/edk/system/ports/name.h
index 1082719f6df5f29c37d3a6bb6df00fc8a78514fd..2e74cd58e534eb1e21bce9cc5399142d91aa5ced 100644
--- a/mojo/edk/system/ports/name.h
+++ b/mojo/edk/system/ports/name.h
@@ -17,7 +17,7 @@ namespace edk {
namespace ports {
struct Name {
- Name(uint64_t v1, uint64_t v2) : v1(v1), v2(v2) {}
+ constexpr Name(uint64_t v1, uint64_t v2) : v1(v1), v2(v2) {}
uint64_t v1, v2;
};
@@ -36,18 +36,19 @@ inline bool operator<(const Name& a, const Name& b) {
std::ostream& operator<<(std::ostream& stream, const Name& name);
struct PortName : Name {
- PortName() : Name(0, 0) {}
- PortName(uint64_t v1, uint64_t v2) : Name(v1, v2) {}
+ constexpr PortName() : Name(0, 0) {}
+ constexpr PortName(uint64_t v1, uint64_t v2) : Name(v1, v2) {}
};
-const PortName kInvalidPortName = {0, 0};
-
struct NodeName : Name {
- NodeName() : Name(0, 0) {}
- NodeName(uint64_t v1, uint64_t v2) : Name(v1, v2) {}
+ constexpr NodeName() : Name(0, 0) {}
+ constexpr NodeName(uint64_t v1, uint64_t v2) : Name(v1, v2) {}
};
-const NodeName kInvalidNodeName = {0, 0};
+struct constants {
+ static constexpr PortName kInvalidPortName = {0, 0};
+ static constexpr NodeName kInvalidNodeName = {0, 0};
+};
} // namespace ports
} // namespace edk
« no previous file with comments | « mojo/edk/system/node_controller.cc ('k') | mojo/edk/system/ports/name.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698