We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1fbc579 commit bc3809eCopy full SHA for bc3809e
1 file changed
src/auxiliary/Future.cpp
@@ -87,16 +87,17 @@ auto DeferredComputation<T>::get() -> T
87
return std::visit(
88
auxiliary::overloaded{
89
[](detail::OneTimeTask<T> &task) -> T { return std::move(task)(); },
90
- [](detail::CachedValue<T> &cached) -> T {
91
- if constexpr (std::is_void_v<T>)
92
- {
93
- return;
94
- }
95
- else
96
97
- return cached.val;
98
99
- }},
+ [](detail::CachedValue<T> &cached) -> T { return cached.val; }},
+ this->m_task);
+}
+
+template <>
+auto DeferredComputation<void>::get() -> void
+{
+ std::visit(
+ auxiliary::overloaded{
+ [](detail::OneTimeTask<void> &task) { std::move(task)(); },
100
+ [](detail::CachedValue<void> &) { return; }},
101
this->m_task);
102
}
103
0 commit comments