mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 04:44:34 +03:00
C.150/C.151: fix compiler syntax error in Example (#1461)
- remove unnecessary space in section Reason
This commit is contained in:
committed by
Sergey Zubkov
parent
a70d903fde
commit
0a58ed2bc3
@@ -7909,7 +7909,7 @@ It also ensures exception safety in complex expressions.
|
|||||||
|
|
||||||
##### Example
|
##### Example
|
||||||
|
|
||||||
unique_ptr<Foo> p {new<Foo>{7}}; // OK: but repetitive
|
unique_ptr<Foo> p {new Foo{7}}; // OK: but repetitive
|
||||||
|
|
||||||
auto q = make_unique<Foo>(7); // Better: no repetition of Foo
|
auto q = make_unique<Foo>(7); // Better: no repetition of Foo
|
||||||
|
|
||||||
@@ -7942,7 +7942,7 @@ It also gives an opportunity to eliminate a separate allocation for the referenc
|
|||||||
|
|
||||||
void test() {
|
void test() {
|
||||||
// OK: but repetitive; and separate allocations for the Bar and shared_ptr's use count
|
// OK: but repetitive; and separate allocations for the Bar and shared_ptr's use count
|
||||||
shared_ptr<Bar> p {new<Bar>{7}};
|
shared_ptr<Bar> p {new Bar{7}};
|
||||||
|
|
||||||
auto q = make_shared<Bar>(7); // Better: no repetition of Bar; one object
|
auto q = make_shared<Bar>(7); // Better: no repetition of Bar; one object
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user