From 5fe619de990f646e474a6e90a4f432075d5abb30 Mon Sep 17 00:00:00 2001 From: Rummskartoffel <20257197+Rummskartoffel@users.noreply.github.com> Date: Sat, 15 Jan 2022 18:34:30 +0100 Subject: [PATCH] Documentation: Update names of RefPtr helper functions This seems to have been missed when these functions were renamed. --- Documentation/SmartPointers.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/SmartPointers.md b/Documentation/SmartPointers.md index 4401af4b35..23253980e2 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... }