Skip to content

Commit 4fc7b50

Browse files
committed
SharedPtr: NULL -> nullptr
ARMmbed/mbed-os#12048 will require that `SharedPtr` users use `nullptr` rather than `NULL` or `0`, which will no longer compile. Update example in code. Change can be made to docs whenever, as `nullptr` form works now.
1 parent 033f3ed commit 4fc7b50

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/api/platform/Callback.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void run_timer_event(Callback<void(float)> on_timer) {
1414
}
1515
```
1616
17-
The only thing to watch out for is that the Callback type has a null Callback, just like a null function pointer. Uninitialized callbacks are null and assert if you call them. If you want a call to always succeed, you need to check if it is null first.
17+
The only thing to watch out for is that the Callback type has an empty Callback, just like a null function pointer. Default initialized callbacks are empty and assert if you call them. If a callback may be empty, you need to check if it is empty before calling it.
1818
1919
``` c++
2020
void run_timer_event(Callback<void(float)> on_timer) {

docs/api/platform/SharedPtr.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ void test() {
2727
// Increase reference count
2828
SharedPtr<MyStruct> ptr2( ptr );
2929
30-
ptr = NULL; // Reference to the struct instance is still held by ptr2
30+
ptr = nullptr; // Reference to the struct instance is still held by ptr2
3131
32-
ptr2 = NULL; // The raw pointer is freed
32+
ptr2 = nullptr; // The raw pointer is freed
3333
}
3434
```

0 commit comments

Comments
 (0)