Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions platform/SharedPtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#include "platform/mbed_critical.h"

namespace mbed {

/** Shared pointer class.
*
* A shared pointer is a "smart" pointer that retains ownership of an object using
Expand Down Expand Up @@ -285,4 +287,10 @@ bool operator!= (U lhs, const SharedPtr<T> &rhs)
return ((T *) lhs != rhs.get());
}

} /* namespace mbed */

#ifndef MBED_NO_GLOBAL_USING_DIRECTIVE
using mbed::SharedPtr;
Copy link

@deepikabhavnani deepikabhavnani Oct 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Along with addition of namespace and backward compatibility, we need to make sure we do not corrupt the global namespace hence a small change needed:

using should be under #ifndef MBED_NO_GLOBAL_USING_DIRECTIVE macro.
https://github.com/ARMmbed/mbed-os/pull/7760/files#diff-3716425795ebc1692d5a64771fa4f35eR169

#endif

#endif // __SHAREDPTR_H__