[libcxx-commits] [libcxx] [libc++][ranges] Implement `ranges::stride_view`. (PR #65200)

Konstantin Varlamov via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 13 23:40:56 PST 2023


================
@@ -0,0 +1,53 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+
+// ranges
+
+// std::views::stride_view
+
+#include "test.h"
+#include "test_convertible.h"
+#include <type_traits>
+
+constexpr bool test_no_default_ctor() {
+  // There is no default ctor for stride_view.
+  static_assert(!std::is_default_constructible_v<std::ranges::stride_view<BidirArrayView<int>>>);
----------------
var-const wrote:

It's ok and IMO preferable to have `static_assert`s in the global scope. We don't gain anything by wrapping them in functions, and comments are more expressive than function names (in this context).

https://github.com/llvm/llvm-project/pull/65200


More information about the libcxx-commits mailing list