From Jason Turner

[re.regex.assign]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpqacpx5uf/{from.md → to.md} +23 -38
tmp/tmpqacpx5uf/{from.md → to.md} RENAMED
@@ -1,108 +1,93 @@
1
- ### `basic_regex` assign <a id="re.regex.assign">[[re.regex.assign]]</a>
2
 
3
  ``` cpp
4
  basic_regex& operator=(const basic_regex& e);
5
  ```
6
 
7
- *Effects:* Copies `e` into `*this` and returns `*this`.
8
-
9
- *Postconditions:* `flags()` and `mark_count()` return `e.flags()` and
10
  `e.mark_count()`, respectively.
11
 
12
  ``` cpp
13
  basic_regex& operator=(basic_regex&& e) noexcept;
14
  ```
15
 
16
- *Effects:* Move assigns from `e` into `*this` and returns `*this`.
17
-
18
- *Postconditions:* `flags()` and `mark_count()` return the values that
19
  `e.flags()` and `e.mark_count()`, respectively, had before assignment.
20
  `e` is in a valid state with unspecified value.
21
 
22
  ``` cpp
23
- basic_regex& operator=(const charT* ptr);
24
  ```
25
 
26
- *Requires:* `ptr` shall not be a null pointer.
27
-
28
- *Effects:* Returns `assign(ptr)`.
29
 
30
  ``` cpp
31
  basic_regex& operator=(initializer_list<charT> il);
32
  ```
33
 
34
- *Effects:* Returns `assign(il.begin(), il.end())`.
35
 
36
  ``` cpp
37
  template<class ST, class SA>
38
- basic_regex& operator=(const basic_string<charT, ST, SA>& p);
39
  ```
40
 
41
- *Effects:* Returns `assign(p)`.
42
 
43
  ``` cpp
44
- basic_regex& assign(const basic_regex& that);
45
  ```
46
 
47
- *Effects:* Equivalent to `*this = that`.
48
-
49
- *Returns:* `*this`.
50
 
51
  ``` cpp
52
- basic_regex& assign(basic_regex&& that) noexcept;
53
  ```
54
 
55
- *Effects:* Equivalent to `*this = std::move(that)`.
56
-
57
- *Returns:* `*this`.
58
 
59
  ``` cpp
60
- basic_regex& assign(const charT* ptr, flag_type f = regex_constants::ECMAScript);
61
  ```
62
 
63
- *Returns:* `assign(string_type(ptr), f)`.
64
 
65
  ``` cpp
66
- basic_regex& assign(const charT* ptr, size_t len, flag_type f = regex_constants::ECMAScript);
67
  ```
68
 
69
- *Returns:* `assign(string_type(ptr, len), f)`.
70
 
71
  ``` cpp
72
- template <class string_traits, class A>
73
- basic_regex& assign(const basic_string<charT, string_traits, A>& s,
74
  flag_type f = regex_constants::ECMAScript);
75
  ```
76
 
77
- *Throws:* `regex_error` if `s` is not a valid regular expression.
78
-
79
  *Returns:* `*this`.
80
 
81
  *Effects:* Assigns the regular expression contained in the string `s`,
82
  interpreted according the flags specified in `f`. If an exception is
83
  thrown, `*this` is unchanged.
84
 
85
- *Postconditions:* If no exception is thrown, `flags()` returns `f` and
86
  `mark_count()` returns the number of marked sub-expressions within the
87
  expression.
88
 
 
 
89
  ``` cpp
90
  template<class InputIterator>
91
  basic_regex& assign(InputIterator first, InputIterator last,
92
  flag_type f = regex_constants::ECMAScript);
93
  ```
94
 
95
- *Requires:* The type `InputIterator` shall satisfy the requirements for
96
- an Input Iterator ([[input.iterators]]).
97
-
98
- *Returns:* `assign(string_type(first, last), f)`.
99
 
100
  ``` cpp
101
  basic_regex& assign(initializer_list<charT> il,
102
  flag_type f = regex_constants::ECMAScript);
103
  ```
104
 
105
- *Effects:* Same as `assign(il.begin(), il.end(), f)`.
106
-
107
- *Returns:* `*this`.
108
 
 
1
+ ### Assignment <a id="re.regex.assign">[[re.regex.assign]]</a>
2
 
3
  ``` cpp
4
  basic_regex& operator=(const basic_regex& e);
5
  ```
6
 
7
+ *Ensures:* `flags()` and `mark_count()` return `e.flags()` and
 
 
8
  `e.mark_count()`, respectively.
9
 
10
  ``` cpp
11
  basic_regex& operator=(basic_regex&& e) noexcept;
12
  ```
13
 
14
+ *Ensures:* `flags()` and `mark_count()` return the values that
 
 
15
  `e.flags()` and `e.mark_count()`, respectively, had before assignment.
16
  `e` is in a valid state with unspecified value.
17
 
18
  ``` cpp
19
+ basic_regex& operator=(const charT* p);
20
  ```
21
 
22
+ *Effects:* Equivalent to: `return assign(p);`
 
 
23
 
24
  ``` cpp
25
  basic_regex& operator=(initializer_list<charT> il);
26
  ```
27
 
28
+ *Effects:* Equivalent to: `return assign(il.begin(), il.end());`
29
 
30
  ``` cpp
31
  template<class ST, class SA>
32
+ basic_regex& operator=(const basic_string<charT, ST, SA>& s);
33
  ```
34
 
35
+ *Effects:* Equivalent to: `return assign(s);`
36
 
37
  ``` cpp
38
+ basic_regex& assign(const basic_regex& e);
39
  ```
40
 
41
+ *Effects:* Equivalent to: `return *this = e;`
 
 
42
 
43
  ``` cpp
44
+ basic_regex& assign(basic_regex&& e) noexcept;
45
  ```
46
 
47
+ *Effects:* Equivalent to: `return *this = std::move(e);`
 
 
48
 
49
  ``` cpp
50
+ basic_regex& assign(const charT* p, flag_type f = regex_constants::ECMAScript);
51
  ```
52
 
53
+ *Effects:* Equivalent to: `return assign(string_type(p), f);`
54
 
55
  ``` cpp
56
+ basic_regex& assign(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript);
57
  ```
58
 
59
+ *Effects:* Equivalent to: `return assign(string_type(p, len), f);`
60
 
61
  ``` cpp
62
+ template<class ST, class SA>
63
+ basic_regex& assign(const basic_string<charT, ST, SA>& s,
64
  flag_type f = regex_constants::ECMAScript);
65
  ```
66
 
 
 
67
  *Returns:* `*this`.
68
 
69
  *Effects:* Assigns the regular expression contained in the string `s`,
70
  interpreted according the flags specified in `f`. If an exception is
71
  thrown, `*this` is unchanged.
72
 
73
+ *Ensures:* If no exception is thrown, `flags()` returns `f` and
74
  `mark_count()` returns the number of marked sub-expressions within the
75
  expression.
76
 
77
+ *Throws:* `regex_error` if `s` is not a valid regular expression.
78
+
79
  ``` cpp
80
  template<class InputIterator>
81
  basic_regex& assign(InputIterator first, InputIterator last,
82
  flag_type f = regex_constants::ECMAScript);
83
  ```
84
 
85
+ *Effects:* Equivalent to: `return assign(string_type(first, last), f);`
 
 
 
86
 
87
  ``` cpp
88
  basic_regex& assign(initializer_list<charT> il,
89
  flag_type f = regex_constants::ECMAScript);
90
  ```
91
 
92
+ *Effects:* Equivalent to: `return assign(il.begin(), il.end(), f);`
 
 
93