File tree 2 files changed +9
-2
lines changed
TESTS/mbed_platform/SharedPtr
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ void test_single_sharedptr_lifetime()
65
65
*/
66
66
void test_instance_sharing ()
67
67
{
68
- SharedPtr<TestStruct> s_ptr1 (NULL );
68
+ SharedPtr<TestStruct> s_ptr1 (nullptr );
69
69
70
70
// Sanity-check value of counter
71
71
TEST_ASSERT_EQUAL (0 , TestStruct::s_count);
@@ -80,7 +80,7 @@ void test_instance_sharing()
80
80
81
81
TEST_ASSERT_EQUAL (1 , TestStruct::s_count);
82
82
83
- s_ptr1 = NULL ;
83
+ s_ptr1 = nullptr ;
84
84
85
85
// Destroy shared pointer
86
86
TEST_ASSERT_EQUAL (0 , TestStruct::s_count);
Original file line number Diff line number Diff line change @@ -75,6 +75,13 @@ class SharedPtr {
75
75
{
76
76
}
77
77
78
+ /* *
79
+ * @brief Create empty SharedPtr not pointing to anything.
80
+ */
81
+ constexpr SharedPtr (std::nullptr_t ) : SharedPtr()
82
+ {
83
+ }
84
+
78
85
/* *
79
86
* @brief Create new SharedPtr
80
87
* @param ptr Pointer to take control over
You can’t perform that action at this time.
0 commit comments