Pārlūkot izejas kodu

Merge pull request #1360 from pherl/master

Use the T() instead of NULL for the default value.
Jisi Liu 9 gadi atpakaļ
vecāks
revīzija
a25e9964b1
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      src/google/protobuf/stubs/statusor.h

+ 1 - 1
src/google/protobuf/stubs/statusor.h

@@ -224,7 +224,7 @@ inline StatusOr<T>& StatusOr<T>::operator=(const StatusOr<T>& other) {
 template<typename T>
 template<typename T>
 template<typename U>
 template<typename U>
 inline StatusOr<T>::StatusOr(const StatusOr<U>& other)
 inline StatusOr<T>::StatusOr(const StatusOr<U>& other)
-    : status_(other.status_), value_(other.status_.ok() ? other.value_ : NULL) {
+    : status_(other.status_), value_(other.status_.ok() ? other.value_ : T()) {
 }
 }
 
 
 template<typename T>
 template<typename T>