You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 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.)
@@ -11,15 +11,15 @@ The \<span> header includes the following non-member functions that operate on *
11
11
|**Non-member functions**|**Description**|
12
12
|-|-|
13
13
|[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. |
15
15
16
16
## <aname="as_bytes"></a>`as_bytes`
17
17
18
18
Get a read-only view of the object representation of the elements in the span.
19
19
20
20
```cpp
21
21
template <classT, size_t Extent>
22
-
auto as_bytes(span<T, Extent> span) noexcept
22
+
auto as_bytes(span<T, Extent> s) noexcept;
23
23
```
24
24
25
25
### Parameters
@@ -28,14 +28,14 @@ auto as_bytes(span<T, Extent> span) noexcept
28
28
The type of the elements in the span.
29
29
30
30
*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.
32
32
33
-
*span*\
33
+
*s*\
34
34
The span to get the raw representation of.
35
35
36
36
### Return Value
37
37
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>`.)
39
39
40
40
### Example
41
41
@@ -57,7 +57,7 @@ If `T` isn't `const`, gets a read/write view to the raw byte representation of t
57
57
58
58
```cpp
59
59
template <classT, size_t Extent>
60
-
auto as_writeable_bytes(span<T, Extent> span) noexcept
60
+
auto as_writable_bytes(span<T, Extent> s) noexcept;
61
61
```
62
62
63
63
### Parameters
@@ -66,14 +66,14 @@ auto as_writeable_bytes(span<T, Extent> span) noexcept
66
66
The type of the elements in the span.
67
67
68
68
*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.
70
70
71
-
*span*\
71
+
*s*\
72
72
The span to get the raw representation of.
73
73
74
74
### Return Value
75
75
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>`.)
0 commit comments