Skip to content

Commit ee9fb77

Browse files
kayla-rColin Robertson
authored andcommitted
* Update how-to-create-and-use-unique-ptr-instances.md Very minor grammar/typo fix. * Update how-to-create-and-use-unique-ptr-instances_3.cpp Minor white-spacing consistency fix.
1 parent d1f576a commit ee9fb77

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/cpp/codesnippet/CPP/how-to-create-and-use-unique-ptr-instances_3.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ class MyClass
77
public:
88

99
// Initialize by using make_unique with ClassFactory default constructor.
10-
MyClass() : factory ( make_unique<ClassFactory>())
10+
MyClass() : factory (make_unique<ClassFactory>())
1111
{
1212
}
1313

1414
void MakeClass()
1515
{
1616
factory->DoSomething();
1717
}
18-
};
18+
};

docs/cpp/how-to-create-and-use-unique-ptr-instances.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A [unique_ptr](../standard-library/unique-ptr-class.md) does not share its point
1717

1818
![Moving the ownership of a unique&#95;ptr](../cpp/media/unique_ptr.png "unique_ptr")
1919

20-
`unique_ptr` is defined in the `<memory>` header in the C++ Standard Library. It is exactly is efficient as a raw pointer and can be used in C++ Standard Library containers. The addition of `unique_ptr` instances to C++ Standard Library containers is efficient because the move constructor of the `unique_ptr` eliminates the need for a copy operation.
20+
`unique_ptr` is defined in the `<memory>` header in the C++ Standard Library. It is exactly as efficient as a raw pointer and can be used in C++ Standard Library containers. The addition of `unique_ptr` instances to C++ Standard Library containers is efficient because the move constructor of the `unique_ptr` eliminates the need for a copy operation.
2121

2222
## Example
2323
The following example shows how to create `unique_ptr` instances and pass them between functions.
@@ -47,4 +47,4 @@ A [unique_ptr](../standard-library/unique-ptr-class.md) does not share its point
4747

4848
## See Also
4949
[Smart Pointers](../cpp/smart-pointers-modern-cpp.md)
50-
[make_unique](../standard-library/memory-functions.md#make_unique)
50+
[make_unique](../standard-library/memory-functions.md#make_unique)

0 commit comments

Comments
 (0)