diff --git a/Documentation/SmartPointers.md b/Documentation/SmartPointers.md index 4401af4b358..23253980e21 100644 --- a/Documentation/SmartPointers.md +++ b/Documentation/SmartPointers.md @@ -90,18 +90,18 @@ Note: A `NonnullRefPtr` can be assigned to a `RefPtr` but not vice versa. To tra ### Construction using helper functions -There is a `create()` global helper function that constructs a new object and returns it wrapped in a `NonnullRefPtr`. All arguments passed to it are forwarded to `T`'s constructor. If memory cannot be allocated for the object, the program is terminated. +There is a `make_ref_counted()` global helper function that constructs a new object and returns it wrapped in a `NonnullRefPtr`. All arguments passed to it are forwarded to `T`'s constructor. If memory cannot be allocated for the object, the program is terminated. ```cpp -NonnullRefPtr our_object = create(); +NonnullRefPtr our_object = make_ref_counted(); NonnullRefPtr another_owner = our_object; ``` -The `try_create()` function constructs an object wrapped in `RefPtr` which may be null if the allocation does not succeed. This allows the calling code to handle allocation failure as it wishes. All arguments passed to it are forwarded to `T`'s constructor. +The `try_make_ref_counted()` function constructs an object wrapped in `RefPtr` which may be null if the allocation does not succeed. This allows the calling code to handle allocation failure as it wishes. All arguments passed to it are forwarded to `T`'s constructor. ```cpp -RefPtr our_object = try_create(); +RefPtr our_object = try_make_ref_counted(); if (!our_object) { // handle allocation failure... }