From: Wolfgang Bangerth Date: Tue, 28 Nov 2023 04:08:40 +0000 (-0700) Subject: Refine a 'requires' clause. X-Git-Tag: relicensing~277^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16297%2Fhead;p=dealii.git Refine a 'requires' clause. --- diff --git a/include/deal.II/base/lazy.h b/include/deal.II/base/lazy.h index a26dea1d62..dbc01eeed9 100644 --- a/include/deal.II/base/lazy.h +++ b/include/deal.II/base/lazy.h @@ -77,12 +77,12 @@ DEAL_II_NAMESPACE_OPEN * }; * ``` * - * @dealiiConceptRequires{std::is_constructible_v && - std::is_assignable_v} + * @dealiiConceptRequires{std::is_move_constructible_v && + std::is_move_assignable_v} */ template -DEAL_II_CXX20_REQUIRES((std::is_constructible_v && - std::is_assignable_v)) +DEAL_II_CXX20_REQUIRES((std::is_move_constructible_v && + std::is_move_assignable_v)) class Lazy { public: @@ -246,16 +246,16 @@ private: template -DEAL_II_CXX20_REQUIRES((std::is_constructible_v && - std::is_assignable_v)) +DEAL_II_CXX20_REQUIRES((std::is_move_constructible_v && + std::is_move_assignable_v)) inline Lazy::Lazy() : object_is_initialized(false) {} template -DEAL_II_CXX20_REQUIRES((std::is_constructible_v && - std::is_assignable_v)) +DEAL_II_CXX20_REQUIRES((std::is_move_constructible_v && + std::is_move_assignable_v)) inline Lazy::Lazy(const Lazy &other) : object(other.object) { @@ -264,8 +264,8 @@ inline Lazy::Lazy(const Lazy &other) template -DEAL_II_CXX20_REQUIRES((std::is_constructible_v && - std::is_assignable_v)) +DEAL_II_CXX20_REQUIRES((std::is_move_constructible_v && + std::is_move_assignable_v)) inline Lazy::Lazy(Lazy &&other) noexcept : object(other.object) { @@ -274,8 +274,8 @@ inline Lazy::Lazy(Lazy &&other) noexcept template -DEAL_II_CXX20_REQUIRES((std::is_constructible_v && - std::is_assignable_v)) +DEAL_II_CXX20_REQUIRES((std::is_move_constructible_v && + std::is_move_assignable_v)) inline Lazy &Lazy::operator=(const Lazy &other) { object = other.object; @@ -285,8 +285,8 @@ inline Lazy &Lazy::operator=(const Lazy &other) template -DEAL_II_CXX20_REQUIRES((std::is_constructible_v && - std::is_assignable_v)) +DEAL_II_CXX20_REQUIRES((std::is_move_constructible_v && + std::is_move_assignable_v)) inline Lazy &Lazy::operator=(Lazy &&other) noexcept { object = other.object; @@ -296,8 +296,8 @@ inline Lazy &Lazy::operator=(Lazy &&other) noexcept template -DEAL_II_CXX20_REQUIRES((std::is_constructible_v && - std::is_assignable_v)) +DEAL_II_CXX20_REQUIRES((std::is_move_constructible_v && + std::is_move_assignable_v)) inline void Lazy::reset() noexcept { object_is_initialized.store(false); @@ -306,8 +306,8 @@ inline void Lazy::reset() noexcept template -DEAL_II_CXX20_REQUIRES((std::is_constructible_v && - std::is_assignable_v)) +DEAL_II_CXX20_REQUIRES((std::is_move_constructible_v && + std::is_move_assignable_v)) template inline DEAL_II_ALWAYS_INLINE void Lazy::ensure_initialized(const Callable &creator) const @@ -370,8 +370,8 @@ inline DEAL_II_ALWAYS_INLINE template -DEAL_II_CXX20_REQUIRES((std::is_constructible_v && - std::is_assignable_v)) +DEAL_II_CXX20_REQUIRES((std::is_move_constructible_v && + std::is_move_assignable_v)) inline DEAL_II_ALWAYS_INLINE bool Lazy::has_value() const { // @@ -385,8 +385,8 @@ inline DEAL_II_ALWAYS_INLINE bool Lazy::has_value() const template -DEAL_II_CXX20_REQUIRES((std::is_constructible_v && - std::is_assignable_v)) +DEAL_II_CXX20_REQUIRES((std::is_move_constructible_v && + std::is_move_assignable_v)) inline DEAL_II_ALWAYS_INLINE const T &Lazy::value() const { Assert( @@ -400,8 +400,8 @@ inline DEAL_II_ALWAYS_INLINE const T &Lazy::value() const template -DEAL_II_CXX20_REQUIRES((std::is_constructible_v && - std::is_assignable_v)) +DEAL_II_CXX20_REQUIRES((std::is_move_constructible_v && + std::is_move_assignable_v)) inline DEAL_II_ALWAYS_INLINE T &Lazy::value() { Assert( @@ -415,8 +415,8 @@ inline DEAL_II_ALWAYS_INLINE T &Lazy::value() template -DEAL_II_CXX20_REQUIRES((std::is_constructible_v && - std::is_assignable_v)) +DEAL_II_CXX20_REQUIRES((std::is_move_constructible_v && + std::is_move_assignable_v)) template inline DEAL_II_ALWAYS_INLINE const T &Lazy::value_or_initialize( const Callable &creator) const @@ -428,8 +428,8 @@ inline DEAL_II_ALWAYS_INLINE const T &Lazy::value_or_initialize( template -DEAL_II_CXX20_REQUIRES((std::is_constructible_v && - std::is_assignable_v)) +DEAL_II_CXX20_REQUIRES((std::is_move_constructible_v && + std::is_move_assignable_v)) template inline DEAL_II_ALWAYS_INLINE T &Lazy::value_or_initialize( const Callable &creator) @@ -441,8 +441,8 @@ inline DEAL_II_ALWAYS_INLINE T &Lazy::value_or_initialize( template -DEAL_II_CXX20_REQUIRES((std::is_constructible_v && - std::is_assignable_v)) +DEAL_II_CXX20_REQUIRES((std::is_move_constructible_v && + std::is_move_assignable_v)) std::size_t Lazy::memory_consumption() const { return MemoryConsumption::memory_consumption(object) + //