Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: docs/optional.md

Issue 2551513002: Fix spelling mistakes in //docs. (Closed)
Patch Set: Undo beng->being Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « docs/memory-infra/heap_profiler.md ('k') | docs/profiling_content_shell_on_android.md » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # base::Optional 1 # base::Optional
2 2
3 `base::Optional<T>` is a container that might contain an instance of `T`. 3 `base::Optional<T>` is a container that might contain an instance of `T`.
4 4
5 [TOC] 5 [TOC]
6 6
7 ## History 7 ## History
8 8
9 [base::Optional<T>](https://code.google.com/p/chromium/codesearch#chromium/src/b ase/optional.h) 9 [base::Optional<T>](https://code.google.com/p/chromium/codesearch#chromium/src/b ase/optional.h)
10 is an implementation of [std::optional<T>](http://en.cppreference.com/w/cpp/util ity/optional), 10 is an implementation of [std::optional<T>](http://en.cppreference.com/w/cpp/util ity/optional),
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 It can also be used for simple types, for example when a structure wants to 94 It can also be used for simple types, for example when a structure wants to
95 represent whether the user or the underlying data structure has some value 95 represent whether the user or the underlying data structure has some value
96 unspecified, a `base::Optional<int>` would be easier to understand than a 96 unspecified, a `base::Optional<int>` would be easier to understand than a
97 special value representing the lack of it. For example, using -1 as the 97 special value representing the lack of it. For example, using -1 as the
98 undefined value when the expected value can't be negative. 98 undefined value when the expected value can't be negative.
99 99
100 ## When not to use? 100 ## When not to use?
101 101
102 It is recommended to not use `base::Optional<T>` as a function parameter as it 102 It is recommended to not use `base::Optional<T>` as a function parameter as it
103 will force the callers to use `base::Optional<T>`. Instead, it is recommended to 103 will force the callers to use `base::Optional<T>`. Instead, it is recommended to
104 keep using `T*` for arguments that can be ommited, with `nullptr` representing 104 keep using `T*` for arguments that can be omitted, with `nullptr` representing
105 no value. 105 no value.
106 106
107 Furthermore, depending on `T`, MSVC might fail to compile code using 107 Furthermore, depending on `T`, MSVC might fail to compile code using
108 `base::Optional<T>` as a parameter because of memory alignment issues. 108 `base::Optional<T>` as a parameter because of memory alignment issues.
OLDNEW
« no previous file with comments | « docs/memory-infra/heap_profiler.md ('k') | docs/profiling_content_shell_on_android.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698