mirror of
https://github.com/jpd002/Play-.git
synced 2025-04-28 13:47:57 +03:00
26 lines
447 B
C
26 lines
447 B
C
![]() |
#pragma once
|
||
|
|
||
|
template <typename Type>
|
||
|
struct OsVariableWrapper
|
||
|
{
|
||
|
public:
|
||
|
explicit OsVariableWrapper(Type* storage) : m_storage(storage) { }
|
||
|
OsVariableWrapper(const OsVariableWrapper&) = delete;
|
||
|
|
||
|
OsVariableWrapper& operator =(const OsVariableWrapper&) = delete;
|
||
|
|
||
|
OsVariableWrapper& operator =(const Type& value)
|
||
|
{
|
||
|
(*m_storage) = value;
|
||
|
return (*this);
|
||
|
}
|
||
|
|
||
|
operator Type() const
|
||
|
{
|
||
|
return *m_storage;
|
||
|
}
|
||
|
|
||
|
private:
|
||
|
Type* m_storage;
|
||
|
};
|