mirror of https://github.com/PrimeDecomp/prime.git
Implement rstl::optional_object_null
This commit is contained in:
parent
6a979e343f
commit
feac221b4d
|
@ -6,10 +6,13 @@
|
||||||
#include "rstl/construct.hpp"
|
#include "rstl/construct.hpp"
|
||||||
|
|
||||||
namespace rstl {
|
namespace rstl {
|
||||||
|
struct optional_object_null {};
|
||||||
|
|
||||||
template < typename T >
|
template < typename T >
|
||||||
class optional_object {
|
class optional_object {
|
||||||
public:
|
public:
|
||||||
optional_object() : m_valid(false) {}
|
optional_object() : m_valid(false) {}
|
||||||
|
optional_object(optional_object_null) : m_valid(false) {}
|
||||||
optional_object(const T& item) : m_valid(true) { rstl::construct< T >(m_data, item); }
|
optional_object(const T& item) : m_valid(true) { rstl::construct< T >(m_data, item); }
|
||||||
optional_object(const optional_object& other) : m_valid(other.m_valid) {
|
optional_object(const optional_object& other) : m_valid(other.m_valid) {
|
||||||
if (other.m_valid) {
|
if (other.m_valid) {
|
||||||
|
|
|
@ -107,6 +107,6 @@ rstl::optional_object< CAABox > CScriptPlatform::GetTouchBounds() const {
|
||||||
return GetBoundingBox();
|
return GetBoundingBox();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return rstl::optional_object< CAABox >();
|
return rstl::optional_object_null();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue