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

Unified Diff: base/optional.h

Issue 2434253003: Make base::Optional constructor constexpr. (Closed)
Patch Set: Created 4 years, 2 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 | base/optional_unittest.cc » ('j') | base/optional_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/optional.h
diff --git a/base/optional.h b/base/optional.h
index 3adda97c0217ee5c05d8c07a0fbaab062714d03a..8d172bbd9ff000b97494a2205865de08c293b1ff 100644
--- a/base/optional.h
+++ b/base/optional.h
@@ -34,7 +34,7 @@ namespace internal {
template <typename T, bool = base::is_trivially_destructible<T>::value>
struct OptionalStorage {
- OptionalStorage() {}
+ constexpr OptionalStorage() {}
// When T is not trivially destructible we must call its
// destructor before deallocating its memory.
~OptionalStorage() {
@@ -54,7 +54,7 @@ struct OptionalStorage {
template <typename T>
struct OptionalStorage<T, true> {
- OptionalStorage() {}
+ constexpr OptionalStorage() {}
// When T is trivially destructible (i.e. its destructor does nothing) there
// is no need to call it. Explicitly defaulting the destructor means it's not
// user-provided. Those two together make this destructor trivial.
« no previous file with comments | « no previous file | base/optional_unittest.cc » ('j') | base/optional_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698