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
C++11 introduces new smart pointers: `std::unique_ptr`, `std::shared_ptr`, `std::weak_ptr`. `std::auto_ptr` now becomes deprecated and then eventually removed in C++17.
807
807
808
-
`std::unique_ptr` is a non-copyable, movable pointer that manages its own heap-allocated memory. **Note: Prefer using the `std::make_X` helper functions as opposed to using constructors. See the sections for [std::make_unique](#stdmake_unique) and [std::make_shared](#stdmake_shared).**
808
+
`std::unique_ptr` is a non-copyable, movable pointer that manages its own heap-allocated memory. **Note: Prefer using the `std::make_X` helper functions as opposed to using constructors. See the sections for [std::make_unique](https://github.com/AnthonyCalandra/modern-cpp-features/blob/master/CPP14.md#stdmake_unique) and [std::make_shared](#stdmake_shared).**
809
809
```c++
810
810
std::unique_ptr<Foo> p1 { new Foo{} }; // `p1` owns `Foo`
811
811
if (p1) {
@@ -952,7 +952,7 @@ auto result = handle.get(); // wait for the result
952
952
```
953
953
954
954
### std::begin/end
955
-
`std::begin` and `std::end` free functions were added to return begin and end iterators of a container generically. These functions also work with raw arrays which do not have begin and end member functions.
955
+
`std::begin` and `std::end` free functions were added to return begin and end iterators of a container generically. These functions also work with raw arrays which do not have `begin` and `end` member functions.
Copy file name to clipboardExpand all lines: CPP14.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -148,7 +148,7 @@ constexpr T e = T(2.7182818284590452353);
148
148
```
149
149
150
150
### [[deprecated]] attribute
151
-
C++14 introduces the `[[deprecated]]` attribute to indicate that a unit (function, class, etc) is discouraged and likely yield compilation warnings. If a reason is provided, it will be included in the warnings.
151
+
C++14 introduces the `[[deprecated]]` attribute to indicate that a unit (function, class, etc.) is discouraged and likely yield compilation warnings. If a reason is provided, it will be included in the warnings.
Copy file name to clipboardExpand all lines: README.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -248,7 +248,7 @@ auto g = []<my_concept auto v> () {
248
248
// ...
249
249
};
250
250
```
251
-
The `requires` keyword is used either to start a requires clause or a requires expression:
251
+
The `requires` keyword is used either to start a `requires` clause or a `requires` expression:
252
252
```c++
253
253
template <typename T>
254
254
requires my_concept<T> // `requires` clause.
@@ -263,7 +263,7 @@ T add(T a, T b) {
263
263
return a + b;
264
264
}
265
265
```
266
-
Note that the parameter list in a requires expression is optional. Each requirement in a requires expression are one of the following:
266
+
Note that the parameter list in a `requires` expression is optional. Each requirement in a `requires` expression are one of the following:
267
267
268
268
***Simple requirements** - asserts that the given expression is valid.
269
269
@@ -392,7 +392,7 @@ while (unlikely_truthy_condition) [[unlikely]] {
392
392
```
393
393
394
394
### Deprecate implicit capture of this
395
-
Implicitly capturing `this` in a lamdba capture using `[=]` is now deprecated; prefer capturing explicitly using `[=, this]` or `[=, *this]`.
395
+
Implicitly capturing `this` in a lambda capture using `[=]` is now deprecated; prefer capturing explicitly using `[=, this]` or `[=, *this]`.
396
396
```c++
397
397
structint_value {
398
398
int n = 0;
@@ -1254,7 +1254,7 @@ constexpr T e = T(2.7182818284590452353);
1254
1254
```
1255
1255
1256
1256
### [[deprecated]] attribute
1257
-
C++14 introduces the `[[deprecated]]` attribute to indicate that a unit (function, class, etc) is discouraged and likely yield compilation warnings. If a reason is provided, it will be included in the warnings.
1257
+
C++14 introduces the `[[deprecated]]` attribute to indicate that a unit (function, class, etc.) is discouraged and likely yield compilation warnings. If a reason is provided, it will be included in the warnings.
1258
1258
```c++
1259
1259
[[deprecated]]
1260
1260
voidold_method();
@@ -2205,7 +2205,7 @@ auto result = handle.get(); // wait for the result
2205
2205
```
2206
2206
2207
2207
### std::begin/end
2208
-
`std::begin` and `std::end` free functions were added to return begin and end iterators of a container generically. These functions also work with raw arrays which do not have begin and end member functions.
2208
+
`std::begin` and `std::end` free functions were added to return begin and end iterators of a container generically. These functions also work with raw arrays which do not have `begin` and `end` member functions.
0 commit comments