mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 13:48:56 +00: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:
parent
0d07821935
commit
38304da947
21 changed files with 182 additions and 172 deletions
|
@ -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(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue