#include <atomic>
#include <mutex>
#include <optional>
+#include <type_traits>
+
DEAL_II_NAMESPACE_OPEN
*/
template <typename Callable>
void
- ensure_initialized(const Callable &creator) const;
+ ensure_initialized(const Callable &creator) const
+ DEAL_II_CXX20_REQUIRES((std::is_invocable_r_v<T, Callable>));
/**
*/
template <typename Callable>
const T &
- value_or_initialize(const Callable &creator) const;
+ value_or_initialize(const Callable &creator) const
+ DEAL_II_CXX20_REQUIRES((std::is_invocable_r_v<T, Callable>));
/**
*/
template <typename Callable>
DEAL_II_ALWAYS_INLINE inline T &
- value_or_initialize(const Callable &creator);
+ value_or_initialize(const Callable &creator)
+ DEAL_II_CXX20_REQUIRES((std::is_invocable_r_v<T, Callable>));
/**
template <typename Callable>
inline DEAL_II_ALWAYS_INLINE void
Lazy<T>::ensure_initialized(const Callable &creator) const
+ DEAL_II_CXX20_REQUIRES((std::is_invocable_r_v<T, Callable>))
{
//
// Use Schmidt's double checking [1] for checking and initializing the
template <typename Callable>
inline DEAL_II_ALWAYS_INLINE const T &
Lazy<T>::value_or_initialize(const Callable &creator) const
+ DEAL_II_CXX20_REQUIRES((std::is_invocable_r_v<T, Callable>))
{
ensure_initialized(creator);
return object.value();
template <typename Callable>
inline DEAL_II_ALWAYS_INLINE T &
Lazy<T>::value_or_initialize(const Callable &creator)
+ DEAL_II_CXX20_REQUIRES((std::is_invocable_r_v<T, Callable>))
{
ensure_initialized(creator);
return object.value();