[libcxx-commits] [libcxx] [libc++]libcxx constexpr deque (PR #200929)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 9 06:40:57 PDT 2026


================
@@ -47,7 +49,23 @@ C make(int size, int start = 0) {
   return c;
 }
 
+#if TEST_STD_VER >= 26
+TEST_CONSTEXPR_CXX26 bool test_constexpr() {
+  std::deque<int> d = {1, 2, 3};
+  assert(d[0] == 1);
+  assert(d.at(2) == 3);
+  assert(d.front() == 1);
+  assert(d.back() == 3);
+  return true;
+}
+#endif
+
 int main(int, char**) {
+#if TEST_STD_VER >= 26
+  assert(test_constexpr());
+  static_assert(test_constexpr());
----------------
frederick-vs-ja wrote:

I'd like to see the function name being `test_lightweight` or something similar.

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


More information about the libcxx-commits mailing list