[libcxx-commits] [libcxx] [libc++] Implement std::move_only_function (P0288R9) (PR #94670)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Nov 23 06:13:20 PST 2025


================
@@ -38,8 +39,10 @@
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <size_t _BufferSize, size_t _BufferAlignment>
-  requires(_BufferSize > 0 && _BufferAlignment > 0)
 class __small_buffer {
+  static_assert(std::has_single_bit(_BufferAlignment), "Alignment is invalid.");
+  static_assert(_BufferSize >= sizeof(byte*), "Buffer has to be capable of storing a pointer for heap allocations!");
+
----------------
huixie90 wrote:

question: why the condition to use small buffer need `is_trivially_move_constructible_v` and `is_trivially_destructible_v`? Can we allow any types that is `no_throw_move_constructible`? 

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


More information about the libcxx-commits mailing list