Skip to content

Commit bf0cb52

Browse files
authored
Document Option<T&> is stored as T*
T& is not actually NeverValueField, it's the storage type chosen inside Option<T&> that is, in that case.
1 parent a3cfa34 commit bf0cb52

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

subspace/option/option.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ using sus::option::__private::StoragePointer;
9393
/// owns the `T` in that case and it ensures the `Option` and the `T` are both
9494
/// accessed with the same const-ness.
9595
///
96-
/// If a type `T` satisties `sus::mem::NeverValueField`, then `Option<T>` will
97-
/// have the same size as T.
96+
/// If a type `T` is a reference or satisties `sus::mem::NeverValueField`, then
97+
/// `Option<T>` will have the same size as T and will be internally represented
98+
/// as just a `T` (or `T*` in the case of a reference `T&`).
9899
template <class T>
99100
class Option final {
100101
// Note that `const T&` is allowed (so we don't `std::remove_reference_t<T>`)

0 commit comments

Comments
 (0)