[libcxx-commits] [libcxx] [libc++] Implement P0843R14: `inplace_vector` (PR #204008)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Sep 23 12:49:03 PDT 2026
================
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+// 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: std-at-least-c++26
+
+// <inplace_vector>
+
+// static constexpr size_type capacity() noexcept;
+
+#include <cassert>
+#include <inplace_vector>
+
+#include "test_macros.h"
+
+constexpr bool test() {
+ {
+ using C = std::inplace_vector<int, 0>;
+ ASSERT_SAME_TYPE(C::size_type, decltype(C::capacity()));
+ C c;
+ assert(c.capacity() == 0);
----------------
ldionne wrote:
I don't think this check is relevant since this is a static member function. Applies to other static functions.
As-is, we're basically testing that the compiler supports both `Class::f()` and `obj.f()` for a static member function `f`, which we should assume to work.
https://github.com/llvm/llvm-project/pull/204008
More information about the libcxx-commits
mailing list