mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
DiscIO: Use Common::Lazy for loading filesystems
This simplifies FileMonitor a lot and also lets us clean up FilesystemPanel.
This commit is contained in:
@ -21,6 +21,16 @@ public:
|
||||
Lazy() : m_value(T()) {}
|
||||
Lazy(const std::variant<T, std::function<T()>>& value) : m_value(value) {}
|
||||
Lazy(std::variant<T, std::function<T()>>&& value) : m_value(std::move(value)) {}
|
||||
const Lazy<T>& operator=(const std::variant<T, std::function<T()>>& value)
|
||||
{
|
||||
m_value = value;
|
||||
return *this;
|
||||
}
|
||||
const Lazy<T>& operator=(std::variant<T, std::function<T()>>&& value)
|
||||
{
|
||||
m_value = std::move(value);
|
||||
return *this;
|
||||
}
|
||||
const T& operator*() const { return *ComputeValue(); }
|
||||
const T* operator->() const { return ComputeValue(); }
|
||||
T& operator*() { return *ComputeValue(); }
|
||||
|
Reference in New Issue
Block a user