Commit 353fc9f1 authored by Philip Rogers's avatar Philip Rogers Committed by Commit Bot

Add OptionalOrNullptr to optional.md docs

This patch adds a mention of OptionalOrNullptr to the optional.md docs.

Change-Id: I7d09afa336bcd06a11756b5d655370d162b80318
Reviewed-on: https://chromium-review.googlesource.com/965585Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543725}
parent a7321fd9
...@@ -109,7 +109,9 @@ undefined value when the expected value can't be negative. ...@@ -109,7 +109,9 @@ undefined value when the expected value can't be negative.
It is recommended to not use `base::Optional<T>` as a function parameter as it It is recommended to not use `base::Optional<T>` as a function parameter as it
will force the callers to use `base::Optional<T>`. Instead, it is recommended to will force the callers to use `base::Optional<T>`. Instead, it is recommended to
keep using `T*` for arguments that can be omitted, with `nullptr` representing keep using `T*` for arguments that can be omitted, with `nullptr` representing
no value. no value. A helper, `base::OptionalOrNullptr`, is available in
[stl_util.h](https://code.google.com/p/chromium/codesearch#chromium/src/base/stl_util.h)
and can make it easier to convert `base::Optional<T>` to `T*`.
Furthermore, depending on `T`, MSVC might fail to compile code using Furthermore, depending on `T`, MSVC might fail to compile code using
`base::Optional<T>` as a parameter because of memory alignment issues. `base::Optional<T>` as a parameter because of memory alignment issues.
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