Skip to content

Commit aed3725

Browse files
Update span-functions.md
* Rename parameter from `span` to `s` to avoid "shadowing" ambiguity. (The Standard says `s` here.) * Add semicolons to declarations. * Fix `Dynamic_Extent` capitalization to `dynamic_extent`. * FIXME NOTES: The claimed return types are incorrect; these functions return `span<const byte, MEOW>` and `span<byte, MEOW>` where `MEOW` is a conditional expression. Noted but not fixed. * RENAMED: The Standard name of the function is `as_writable_bytes`, not `writeable`. I've replaced all occurrences in this document; please check any cross-references. (This was renamed during Standardization, so old mentions may be common. We never shipped the old name in the STL.)
1 parent a5f1229 commit aed3725

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

docs/standard-library/span-functions.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: "&lt;span&gt; functions"
33
ms.date: "05/13/2020"
4-
f1_keywords: ["span/std::span::as_bytes", "span/std::as_writeable_bytes"]
5-
helpviewer_keywords: ["std::span [C++], as_writeable_bytes", "std::as_bytes [C++]"]
4+
f1_keywords: ["span/std::span::as_bytes", "span/std::as_writable_bytes"]
5+
helpviewer_keywords: ["std::span [C++], as_writable_bytes", "std::as_bytes [C++]"]
66
---
77
# &lt;span&gt; functions
88

@@ -11,15 +11,15 @@ The \<span> header includes the following non-member functions that operate on *
1111
| **Non-member functions** | **Description** |
1212
|-|-|
1313
|[as_bytes](#as_bytes) | Get a read-only view of the object representation of the elements in the span. |
14-
|[as_writeable_bytes](#as_writable_bytes) | Get a read/write view to the object representation of the elements in the span. |
14+
|[as_writable_bytes](#as_writable_bytes) | Get a read/write view to the object representation of the elements in the span. |
1515

1616
## <a name="as_bytes"></a>`as_bytes`
1717

1818
Get a read-only view of the object representation of the elements in the span.
1919

2020
```cpp
2121
template <class T, size_t Extent>
22-
auto as_bytes(span<T, Extent> span) noexcept
22+
auto as_bytes(span<T, Extent> s) noexcept;
2323
```
2424
2525
### Parameters
@@ -28,14 +28,14 @@ auto as_bytes(span<T, Extent> span) noexcept
2828
The type of the elements in the span.
2929
3030
*Extent*\
31-
The number of elements in the span (if known at compile time), otherwise `Dynamic_Extent` indicating that the number of elements isn't known until runtime.
31+
The number of elements in the span (if known at compile time), otherwise `dynamic_extent` indicating that the number of elements isn't known until runtime.
3232
33-
*span*\
33+
*s*\
3434
The span to get the raw representation of.
3535
3636
### Return Value
3737
38-
A `const byte*` to the first item stored in the span. If the span is empty, returns `nullptr`.
38+
A `const byte*` to the first item stored in the span. If the span is empty, returns `nullptr`. (FIXME: Actually, this returns `span<const byte, MEOW>`.)
3939
4040
### Example
4141
@@ -57,7 +57,7 @@ If `T` isn't `const`, gets a read/write view to the raw byte representation of t
5757

5858
```cpp
5959
template <class T, size_t Extent>
60-
auto as_writeable_bytes(span<T, Extent> span) noexcept
60+
auto as_writable_bytes(span<T, Extent> s) noexcept;
6161
```
6262
6363
### Parameters
@@ -66,14 +66,14 @@ auto as_writeable_bytes(span<T, Extent> span) noexcept
6666
The type of the elements in the span.
6767
6868
*Extent*\
69-
The number of elements in the span (if known at compile time), otherwise `Dynamic_Extent` indicating that the number of elements isn't known until runtime.
69+
The number of elements in the span (if known at compile time), otherwise `dynamic_extent` indicating that the number of elements isn't known until runtime.
7070
71-
*span*\
71+
*s*\
7272
The span to get the raw representation of.
7373
7474
### Return Value
7575
76-
A `byte*` to the first item stored in the span. If the span is empty, returns `nullptr`.
76+
A `byte*` to the first item stored in the span. If the span is empty, returns `nullptr`. (FIXME: Actually, this returns `span<byte, MEOW>`.)
7777
7878
### Example
7979

0 commit comments

Comments
 (0)