6#ifndef SIMPLE_UTILITY_FUNCTIONAL_MIXINS_NEGATION_HPP
7#define SIMPLE_UTILITY_FUNCTIONAL_MIXINS_NEGATION_HPP
19 template <concepts::unqualified Derived>
24 constexpr const Derived& derived()
const noexcept
26 return static_cast<const Derived&
>(*this);
30 constexpr Derived& derived()
noexcept
32 return static_cast<Derived&
>(*this);
39 static_assert(std::is_base_of_v<NegationOperator, Derived>,
"Derived doesn't inherit from NegationOperator.");
41 std::copy_constructible<Derived> || std::move_constructible<Derived>,
42 "Derived is neither move- nor copy-constructible.");
57 constexpr auto operator !() const & noexcept(std::is_nothrow_copy_constructible_v<Derived>)
59 return envelop<closure_template<Derived>::template type>(
60 std::not_fn(derived()));
64 constexpr auto operator !() &&
noexcept(std::is_nothrow_move_constructible_v<Derived>)
66 return envelop<closure_template<Derived>::template type>(
67 std::not_fn(std::move(derived())));
Definition: Negation.hpp:21
NegationOperator(NegationOperator &&)=default
NegationOperator(const NegationOperator &)=default
NegationOperator & operator=(const NegationOperator &)=default
constexpr NegationOperator() noexcept
Definition: Negation.hpp:37
~NegationOperator()=default
constexpr auto operator!() const &noexcept(std::is_nothrow_copy_constructible_v< Derived >)
Definition: Negation.hpp:57
Definition: Arithmetic.hpp:13