mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #8001 from kjbracey-arm/singletonptr_star
Add * operator to SingletonPtrpull/7948/head
commit
f529dc799e
|
@ -113,6 +113,16 @@ struct SingletonPtr {
|
|||
return get();
|
||||
}
|
||||
|
||||
/** Get a reference to the underlying singleton
|
||||
*
|
||||
* @returns
|
||||
* A reference to the singleton
|
||||
*/
|
||||
T &operator*()
|
||||
{
|
||||
return *get();
|
||||
}
|
||||
|
||||
// This is zero initialized when in global scope
|
||||
T *_ptr;
|
||||
// Force data to be 4 byte aligned
|
||||
|
|
Loading…
Reference in New Issue