17 using first_type = bool;
18 [[nodiscard]]
constexpr bool any() const noexcept {
20 BoolN::forEachComponent([&]<
typename axis_type,
size_t iter> {
21 res = res ||
static_cast<T const*
>(
this)->
template get<bool, iter>();
25 [[nodiscard]]
constexpr bool all() const noexcept {
27 BoolN::forEachComponent([&]<
typename axis_type,
size_t iter> {
28 res = res &&
static_cast<T const*
>(
this)->
template get<bool, iter>();
32 [[nodiscard]]
constexpr T operator!() const noexcept {
33 T tmp = *(
static_cast<T const*
>(
this));
34 BoolN::forEachComponent([&]<
typename axis_type,
size_t iter> {
35 tmp.template get<bool, iter>() = !(tmp.template get<bool, iter>());
39 [[nodiscard]]
constexpr T operator||(T
const& x)
const noexcept {
40 T tmp = *(
static_cast<T const*
>(
this));
41 BoolN::forEachComponent([&]<
typename axis_type,
size_t iter> {
42 tmp.template get<bool, iter>() = tmp.template get<bool, iter>() || x.template get<bool, iter>();
46 [[nodiscard]]
constexpr T operator&&(T
const& x)
const noexcept {
47 T tmp = *(
static_cast<T const*
>(
this));
48 BoolN::forEachComponent([&]<
typename axis_type,
size_t iter> {
49 tmp.template get<bool, iter>() = tmp.template get<bool, iter>() && x.template get<bool, iter>();
53 [[nodiscard]]
constexpr T
operator xor(T
const& x)
const noexcept {
54 T tmp = *(
static_cast<T const*
>(
this));
55 BoolN::forEachComponent([&]<
typename axis_type,
size_t iter> {
56 tmp.template get<bool, iter>() = tmp.template get<bool, iter>() xor x.template get<
bool, iter>();
60 [[nodiscard]] constexpr T xnor(T const& x) const noexcept {
61 T tmp = *(
static_cast<T const*
>(
this));
62 BoolN::forEachComponent([&]<
typename axis_type,
size_t iter> {
63 tmp.template get<bool, iter>() = !(tmp.template get<bool, iter>() xor x.template get<
bool, iter>());
67 [[nodiscard]] constexpr T operator||(first_type const& x) const noexcept {
68 T tmp = *(
static_cast<T const*
>(
this));
69 BoolN::forEachComponent([&]<
typename axis_type,
size_t iter> {
70 tmp.template get<bool, iter>() = tmp.template get<bool, iter>() || x;
74 [[nodiscard]]
constexpr T operator&&(first_type
const& x)
const noexcept {
75 T tmp = *(
static_cast<T const*
>(
this));
76 BoolN::forEachComponent([&]<
typename axis_type,
size_t iter> {
77 tmp.template get<bool, iter>() = tmp.template get<bool, iter>() && x;
81 [[nodiscard]]
constexpr T
operator xor(first_type
const& x)
const noexcept {
82 T tmp = *(
static_cast<T const*
>(
this));
83 BoolN::forEachComponent([&]<
typename axis_type,
size_t iter> {
84 tmp.template get<bool, iter>() = tmp.template get<bool, iter>() xor x;
88 [[nodiscard]] constexpr T xnor(first_type const& x) const noexcept {
89 T tmp = *(
static_cast<T const*
>(
this));
90 BoolN::forEachComponent([&]<
typename axis_type,
size_t iter> {
91 tmp.template get<bool, iter>() = !(tmp.template get<bool, iter>() xor x);
95 explicit(false) operator
bool() const noexcept {
return all(); }
115 x.template get<bool, iter>() ? a.template get<axis_type, iter>() : b.template get<axis_type, iter>();