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.

Accepted Answer

Thinking further... If you want to use SharedPointer with Mbed OS here's a few things you could do:

  • Wait for Mbed OS to support C++11
posted by Sarah Marsh 06 Nov 2017