From e164f1083fd08e61bbad9c79a37058f1aeca4086 Mon Sep 17 00:00:00 2001 From: Jisi Liu Date: Tue, 29 Mar 2016 15:25:49 -0700 Subject: [PATCH] Use the T() instead of NULL for the default value. The template can be specialized on primitives, e.g. double, where converting NULL will trigger a warning. --- src/google/protobuf/stubs/statusor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/stubs/statusor.h b/src/google/protobuf/stubs/statusor.h index ad848701b..29f869ad5 100644 --- a/src/google/protobuf/stubs/statusor.h +++ b/src/google/protobuf/stubs/statusor.h @@ -224,7 +224,7 @@ inline StatusOr& StatusOr::operator=(const StatusOr& other) { template template inline StatusOr::StatusOr(const StatusOr& other) - : status_(other.status_), value_(other.status_.ok() ? other.value_ : NULL) { + : status_(other.status_), value_(other.status_.ok() ? other.value_ : T()) { } template