Commit e164f108 authored by Jisi Liu's avatar Jisi Liu

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.
parent 261ee021
......@@ -224,7 +224,7 @@ inline StatusOr<T>& StatusOr<T>::operator=(const StatusOr<T>& other) {
template<typename T>
template<typename U>
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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment