Skip to content

Commit f7627d8

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#51 from captainnumerica/patch-1
fixing formatting issue
2 parents 47a6b95 + 6ba1f3f commit f7627d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/cpp/template-specialization-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ PTS<int S::*>::IsPointer == 0 PTS<int S::*>::IsPointerToDataMember == 1
8989
```
9090

9191
## Example
92-
If you have a template collection class that takes any type **T**, you can create a partial specialization that takes any pointer type **T\***. The following code demonstrates a collection class template `Bag` and a partial specialization for pointer types in which the collection dereferences the pointer types before copying them to the array. The collection then stores the values that are pointed to. With the original template, only the pointers themselves would have been stored in the collection, leaving the data vulnerable to deletion or modification. In this special pointer version of the collection, code to check for a null pointer in the `add` method is added.
92+
If you have a template collection class that takes any type **T**, you can create a partial specialization that takes any pointer type **T***. The following code demonstrates a collection class template `Bag` and a partial specialization for pointer types in which the collection dereferences the pointer types before copying them to the array. The collection then stores the values that are pointed to. With the original template, only the pointers themselves would have been stored in the collection, leaving the data vulnerable to deletion or modification. In this special pointer version of the collection, code to check for a null pointer in the `add` method is added.
9393

9494
```
9595
// partial_specialization_of_class_templates2.cpp

0 commit comments

Comments
 (0)