From Jason Turner

[string.view.cons]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp44evjzop/{from.md → to.md} +28 -9
tmp/tmp44evjzop/{from.md → to.md} RENAMED
@@ -2,29 +2,48 @@
2
 
3
  ``` cpp
4
  constexpr basic_string_view() noexcept;
5
  ```
6
 
7
- *Effects:* Constructs an empty `basic_string_view`.
8
-
9
- *Postconditions:* `size_ == 0` and `data_ == nullptr`.
10
 
11
  ``` cpp
12
  constexpr basic_string_view(const charT* str);
13
  ```
14
 
15
- *Requires:* \[`str`, `str + traits::length(str)`) is a valid range.
16
 
17
- *Effects:* Constructs a `basic_string_view`, with the postconditions in
18
- Table  [[tab:string.view.ctr.2]].
19
 
20
  *Complexity:* 𝑂(`traits::length(str)`).
21
 
22
  ``` cpp
23
  constexpr basic_string_view(const charT* str, size_type len);
24
  ```
25
 
26
- *Requires:* \[`str`, `str + len`) is a valid range.
27
 
28
- *Effects:* Constructs a `basic_string_view`, with the postconditions in
29
- Table  [[tab:string.view.ctr.3]].
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
 
2
 
3
  ``` cpp
4
  constexpr basic_string_view() noexcept;
5
  ```
6
 
7
+ *Ensures:* `size_ == 0` and `data_ == nullptr`.
 
 
8
 
9
  ``` cpp
10
  constexpr basic_string_view(const charT* str);
11
  ```
12
 
13
+ *Preconditions:* \[`str`, `str + traits::length(str)`) is a valid range.
14
 
15
+ *Effects:* Constructs a `basic_string_view`, initializing `data_` with
16
+ `str` and initializing `size_` with `traits::length(str)`.
17
 
18
  *Complexity:* 𝑂(`traits::length(str)`).
19
 
20
  ``` cpp
21
  constexpr basic_string_view(const charT* str, size_type len);
22
  ```
23
 
24
+ *Preconditions:* \[`str`, `str + len`) is a valid range.
25
 
26
+ *Effects:* Constructs a `basic_string_view`, initializing `data_` with
27
+ `str` and initializing `size_` with `len`.
28
+
29
+ ``` cpp
30
+ template<class It, class End>
31
+ constexpr basic_string_view(It begin, End end);
32
+ ```
33
+
34
+ *Constraints:*
35
+
36
+ - `It` satisfies `contiguous_iterator`.
37
+ - `End` satisfies `sized_sentinel_for<It>`.
38
+ - `is_same_v<iter_value_t<It>, charT>` is `true`.
39
+ - `is_convertible_v<End, size_type>` is `false`.
40
+
41
+ *Preconditions:*
42
+
43
+ - \[`begin`, `end`) is a valid range.
44
+ - `It` models `contiguous_iterator`.
45
+ - `End` models `sized_sentinel_for<It>`.
46
+
47
+ *Effects:* Initializes `data_` with `to_address(begin)` and initializes
48
+ `size_` with `end - begin`.
49