From 421d2c209bf669d58fe8d1b3d035203a6d8d4176 Mon Sep 17 00:00:00 2001 From: Christian Trott Date: Fri, 14 Jun 2024 11:23:03 -0600 Subject: [PATCH] Replace spelled out logical operators: breaks Kokkos windows tests (#344) Co-authored-by: Thomas Padioleau --- include/experimental/__p0009_bits/layout_stride.hpp | 8 ++++---- include/experimental/__p0009_bits/macros.hpp | 4 ++-- include/experimental/__p0009_bits/utility.hpp | 2 +- include/experimental/__p2642_bits/layout_padded_fwd.hpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/experimental/__p0009_bits/layout_stride.hpp b/include/experimental/__p0009_bits/layout_stride.hpp index ea2cd380..d6cdad2a 100644 --- a/include/experimental/__p0009_bits/layout_stride.hpp +++ b/include/experimental/__p0009_bits/layout_stride.hpp @@ -605,7 +605,7 @@ struct layout_stride { ) MDSPAN_INLINE_FUNCTION friend constexpr bool operator!=(const mapping& x, const StridedLayoutMapping& y) noexcept { - return not (x == y); + return !(x == y); } MDSPAN_TEMPLATE_REQUIRES( @@ -643,8 +643,8 @@ constexpr void validate_strides(with_rank<0>, Layout, const Extents&, const Mapp template constexpr void validate_strides(with_rank, Layout, const Extents& ext, const Mapping& other) { - static_assert(std::is_same::value and - (std::is_same::value or + static_assert(std::is_same::value && + (std::is_same::value || std::is_same::value) , "This function is only intended to validate construction of " "a layout_left or layout_right mapping from a layout_stride mapping."); @@ -657,7 +657,7 @@ constexpr void validate_strides(with_rank, Layout, const Extents& ext, const const std::size_t s = is_left ? r : N - 1 - r; MDSPAN_IMPL_PRECONDITION(common_integral_compare(expected_stride, other.stride(s)) - and "invalid strides for layout_{left,right}"); + && "invalid strides for layout_{left,right}"); expected_stride *= ext.extent(s); } diff --git a/include/experimental/__p0009_bits/macros.hpp b/include/experimental/__p0009_bits/macros.hpp index 30209a66..f7b93744 100644 --- a/include/experimental/__p0009_bits/macros.hpp +++ b/include/experimental/__p0009_bits/macros.hpp @@ -151,7 +151,7 @@ namespace detail { template MDSPAN_FUNCTION constexpr void precondition(const char* cond, const char* file, unsigned line) { - if (not check) { return; } + if (!check) { return; } // in case the macro doesn't use the arguments for custom macros (void) cond; (void) file; @@ -164,7 +164,7 @@ MDSPAN_FUNCTION constexpr void precondition(const char* cond, const char* file, #define MDSPAN_IMPL_PRECONDITION(...) \ do { \ - if (not (__VA_ARGS__)) { \ + if (!(__VA_ARGS__)) { \ MDSPAN_IMPL_STANDARD_NAMESPACE::detail::precondition(#__VA_ARGS__, __FILE__, __LINE__); \ } \ } while (0) diff --git a/include/experimental/__p0009_bits/utility.hpp b/include/experimental/__p0009_bits/utility.hpp index ca821176..560b7b50 100644 --- a/include/experimental/__p0009_bits/utility.hpp +++ b/include/experimental/__p0009_bits/utility.hpp @@ -16,7 +16,7 @@ using with_rank = std::integral_constant; template constexpr bool common_integral_compare(I1 x, I2 y) { - static_assert(std::is_integral::value and + static_assert(std::is_integral::value && std::is_integral::value, ""); using I = std::common_type_t; diff --git a/include/experimental/__p2642_bits/layout_padded_fwd.hpp b/include/experimental/__p2642_bits/layout_padded_fwd.hpp index b5eaac95..18daa28c 100644 --- a/include/experimental/__p2642_bits/layout_padded_fwd.hpp +++ b/include/experimental/__p2642_bits/layout_padded_fwd.hpp @@ -102,7 +102,7 @@ constexpr void check_padded_layout_converting_constructor_mandates(MDSPAN_IMPL_S (extents_type::static_extent(idx) != dynamic_extent) && (padding_value != dynamic_extent); - static_assert(not statically_determinable or + static_assert(!statically_determinable || (padding_value == 0 ? _LayoutExtentsType::static_extent(idx) == 0 : _LayoutExtentsType::static_extent(idx) % padding_value == 0),