Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 1 month ago.
How to use Shared Pointer in online complier?
Hi,
i can't get Shared pointer to work in the online complier .
i used following constructors with and without namespace
mbed::util::SharedPointer< T >::SharedPointer(); util::SharedPointer< T >::SharedPointer(); SharedPointer< T >::SharedPointer();
with and without #include <SharedPointer.h>
the complier cannot find SharedPointer ( or SharedPointer.h)
it should be in the mbed library. mbed docs = https://docs.mbed.com/docs/core-util-api/en/latest/api/classmbed_1_1util_1_1SharedPointer.html
1 Answer
7 years, 1 month ago.
Hey Steen,
Are you using Mbed OS? This class existed in an older version of the Mbed library, and it is not supported in Mbed OS.
Can I ask where you saw this code used? The documentation you linked is out of date.
Thinking further... If you want to use SharedPointer with Mbed OS here's a few things you could do:
- Copy this file to your mbed directory - https://github.com/ARMmbed/core-util/blob/master/core-util/SharedPointer.h
- Open a PR against Mbed OS to add SharedPointer file - https://github.com/ARMmbed/mbed-os
- Wait for Mbed OS to support C++11