Add get() functionality to static_pointer
This commit is contained in:
parent
eef2e1318c
commit
0ba9416a57
@ -8,8 +8,11 @@
|
||||
#ifndef SKULLC_UTILITY_STATICPOINTER_HPP_
|
||||
#define SKULLC_UTILITY_STATICPOINTER_HPP_
|
||||
|
||||
#include <new>
|
||||
#include <utility>
|
||||
|
||||
#include <utility_assert.hpp>
|
||||
|
||||
namespace Utility
|
||||
{
|
||||
|
||||
@ -57,6 +60,17 @@ struct StaticPointer
|
||||
return initialized_;
|
||||
}
|
||||
|
||||
value_type* get()
|
||||
{
|
||||
SKULLC_ASSERT_DEBUG(initialized_);
|
||||
return reinterpret_cast<value_type*>(storage);
|
||||
}
|
||||
|
||||
const value_type* get() const
|
||||
{
|
||||
SKULLC_ASSERT_DEBUG(initialized_);
|
||||
return reinterpret_cast<const value_type*>(storage);
|
||||
}
|
||||
private:
|
||||
bool initialized_ = false;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user