File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
TESTS/mbed_platform/SharedPtr Expand file tree Collapse file tree 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()
6565 */
6666void test_instance_sharing ()
6767{
68- SharedPtr<TestStruct> s_ptr1 (NULL );
68+ SharedPtr<TestStruct> s_ptr1 (nullptr );
6969
7070 // Sanity-check value of counter
7171 TEST_ASSERT_EQUAL (0 , TestStruct::s_count);
@@ -80,7 +80,7 @@ void test_instance_sharing()
8080
8181 TEST_ASSERT_EQUAL (1 , TestStruct::s_count);
8282
83- s_ptr1 = NULL ;
83+ s_ptr1 = nullptr ;
8484
8585 // Destroy shared pointer
8686 TEST_ASSERT_EQUAL (0 , TestStruct::s_count);
Original file line number Diff line number Diff line change @@ -75,6 +75,13 @@ class SharedPtr {
7575 {
7676 }
7777
78+ /* *
79+ * @brief Create empty SharedPtr not pointing to anything.
80+ */
81+ constexpr SharedPtr (std::nullptr_t ) : SharedPtr()
82+ {
83+ }
84+
7885 /* *
7986 * @brief Create new SharedPtr
8087 * @param ptr Pointer to take control over
You can’t perform that action at this time.
0 commit comments