[libcxx-commits] [libcxx] [libc++] Flat containers should reject `vector<bool, Alloc>` (PR #224886)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Sun Sep 20 00:28:07 PDT 2026


================
@@ -24,6 +24,12 @@ class vector;
 template <class _Allocator>
 class vector<bool, _Allocator>;
 
+template <class _Tp>
+inline constexpr bool __is_vector_bool_v  = false;
+
+template <class _Allocator>
+inline constexpr bool __is_vector_bool_v<vector<bool, _Allocator>> = true;
----------------
frederick-vs-ja wrote:

I think we should either
- guard these with `#if _LIBCPP_STD_VER >= 23` (or `#ifndef _LIBCPP_CXX03_LANG`?), or
- unconditionally provide these, but use `const` instead of `constexpr` and add a space between `>>`.

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


More information about the libcxx-commits mailing list