[nostalgia/core] Give preload version of AssetRef a default constructor

This commit is contained in:
Gary Talent 2022-12-03 01:53:34 -06:00
parent b39a125264
commit ab8b1e4925

View File

@ -265,26 +265,28 @@ class AssetManager {
template<typename T>
class AssetRef {
private:
T &m_obj;
const T *m_obj = nullptr;
public:
explicit constexpr AssetRef(T &obj) noexcept: m_obj(obj) {
constexpr AssetRef() noexcept = default;
explicit constexpr AssetRef(const T *obj) noexcept: m_obj(obj) {
}
constexpr const T *get() const noexcept {
return &m_obj;
return m_obj;
}
constexpr const T &operator*() const & noexcept {
return &m_obj;
return *m_obj;
}
constexpr const T &&operator*() const && noexcept {
return &m_obj;
return *m_obj;
}
constexpr const T *operator->() const noexcept {
return &m_obj;
return m_obj;
}
explicit constexpr operator bool() const noexcept {