//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // REQUIRES: has-unix-headers // UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // UNSUPPORTED: !libcpp-has-hardened-mode && !libcpp-has-debug-mode // XFAIL: availability-verbose_abort-missing // // layout_left::mapping // // constexpr index_type stride(rank_type i) const noexcept; // // Constraints: extents_type::rank() > 0 is true. // // Preconditions: i < extents_type::rank() is true. // // Returns: extents().rev-prod-of-extents(i). // // #include #include #include "check_assertion.h" int main(int, char**) { // value out of range { std::layout_left::template mapping> m{std::dextents{100, 100, 100}}; TEST_LIBCPP_ASSERT_FAILURE(m.stride(4), "invalid rank index"); } return 0; }