diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2018-08-08 17:14:42 -0700 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2018-08-08 17:14:42 -0700 |
commit | a8465b738e5a1f346ece58ea6f82612bcd6659d2 (patch) | |
tree | b755540a5d7d2cc988eabc7ac594e6abd9da29d1 /src/google/protobuf/stubs/statusor.h | |
parent | 6bbe197e9c1b6fc38cbdc45e3bf83fa7ced792a3 (diff) | |
parent | 9bbc4b1fab8262958c172f2d8e87b486c950a051 (diff) | |
download | protobuf-a8465b738e5a1f346ece58ea6f82612bcd6659d2.tar.gz protobuf-a8465b738e5a1f346ece58ea6f82612bcd6659d2.tar.bz2 protobuf-a8465b738e5a1f346ece58ea6f82612bcd6659d2.zip |
Merge master branch.
Diffstat (limited to 'src/google/protobuf/stubs/statusor.h')
-rw-r--r-- | src/google/protobuf/stubs/statusor.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/google/protobuf/stubs/statusor.h b/src/google/protobuf/stubs/statusor.h index 29f869ad..b1c1e6b4 100644 --- a/src/google/protobuf/stubs/statusor.h +++ b/src/google/protobuf/stubs/statusor.h @@ -33,7 +33,7 @@ // usable value, or an error Status explaining why such a value is // not present. To this end, StatusOr<T> does not allow its Status // value to be Status::OK. Further, StatusOr<T*> does not allow the -// contained pointer to be NULL. +// contained pointer to be nullptr. // // The primary use-case for StatusOr<T> is as the return value of a // function which may fail. @@ -114,15 +114,15 @@ class StatusOr { StatusOr(const Status& status); // NOLINT // Construct a new StatusOr with the given value. If T is a plain pointer, - // value must not be NULL. After calling this constructor, calls to + // value must not be nullptr. After calling this constructor, calls to // ValueOrDie() will succeed, and calls to status() will return OK. // // NOTE: Not explicit - we want to use StatusOr<T> as a return type // so it is convenient and sensible to be able to do 'return T()' // when when the return type is StatusOr<T>. // - // REQUIRES: if T is a plain pointer, value != NULL. This requirement is - // DCHECKed. In optimized builds, passing a NULL pointer here will have + // REQUIRES: if T is a plain pointer, value != nullptr. This requirement is + // DCHECKed. In optimized builds, passing a null pointer here will have // the effect of passing PosixErrorSpace::EINVAL as a fallback. StatusOr(const T& value); // NOLINT @@ -174,13 +174,13 @@ class LIBPROTOBUF_EXPORT StatusOrHelper { template<typename T> struct StatusOrHelper::Specialize { - // For non-pointer T, a reference can never be NULL. + // For non-pointer T, a reference can never be nullptr. static inline bool IsValueNull(const T& t) { return false; } }; template<typename T> struct StatusOrHelper::Specialize<T*> { - static inline bool IsValueNull(const T* t) { return t == NULL; } + static inline bool IsValueNull(const T* t) { return t == nullptr; } }; } // namespace internal @@ -202,7 +202,7 @@ inline StatusOr<T>::StatusOr(const Status& status) { template<typename T> inline StatusOr<T>::StatusOr(const T& value) { if (internal::StatusOrHelper::Specialize<T>::IsValueNull(value)) { - status_ = Status(error::INTERNAL, "NULL is not a vaild argument."); + status_ = Status(error::INTERNAL, "nullptr is not a vaild argument."); } else { status_ = Status::OK; value_ = value; |