File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,7 +93,9 @@ struct less<openPMD::InvalidatableFile>
9393{
9494 using first_argument_type = openPMD::InvalidatableFile;
9595 using second_argument_type = first_argument_type;
96- using result_type = typename std::less<std::string>::result_type;
96+ using result_type = decltype (std::less<>()(
97+ *std::declval<first_argument_type const &>(),
98+ *std::declval<second_argument_type const &>()));
9799 result_type
98100 operator ()(first_argument_type const &, second_argument_type const &) const ;
99101};
Original file line number Diff line number Diff line change 11#pragma once
22
33#include < functional>
4+ #include < type_traits>
45#include < variant>
56
67namespace openPMD ::auxiliary::detail
@@ -69,6 +70,15 @@ class DeferredComputation
6970 */
7071 DeferredComputation (cached_type val);
7172
73+ explicit DeferredComputation ();
74+
75+ DeferredComputation (DeferredComputation &&) noexcept ;
76+ DeferredComputation (DeferredComputation const &) = delete ;
77+
78+ auto operator =(DeferredComputation &&) noexcept -> DeferredComputation &;
79+ auto operator =(DeferredComputation const &)
80+ -> DeferredComputation & = delete ;
81+
7282 ~DeferredComputation ();
7383
7484 /* * Get the result of the computation
Original file line number Diff line number Diff line change @@ -131,7 +131,11 @@ std::future<void> AbstractIOHandler::flush(internal::ParsedFlushParams ¶ms)
131131 // been flushed already.
132132 bool increase_flush_counter = !m_work.empty ();
133133 auto res = this ->flush_impl (params);
134- if (increase_flush_counter && m_work.empty ())
134+ if (!m_work.empty ())
135+ {
136+ throw error::Internal (" flush() did not clear all work!" );
137+ }
138+ if (increase_flush_counter)
135139 {
136140 ++*m_flushCounter;
137141 }
Original file line number Diff line number Diff line change @@ -53,6 +53,17 @@ DeferredComputation<T>::DeferredComputation(cached_type cached_val)
5353 : m_task(detail::CachedValue<T>{std::move (cached_val)})
5454{}
5555
56+ template <typename T>
57+ DeferredComputation<T>::DeferredComputation() = default ;
58+
59+ template <typename T>
60+ DeferredComputation<T>::DeferredComputation(DeferredComputation &&) noexcept =
61+ default ;
62+
63+ template <typename T>
64+ auto DeferredComputation<T>::operator =(DeferredComputation &&) noexcept
65+ -> DeferredComputation & = default ;
66+
5667template <typename T>
5768DeferredComputation<T>::~DeferredComputation ()
5869{
You can’t perform that action at this time.
0 commit comments