[libcxx-commits] [libcxx] [llvm] [libc++] Implement P1885R12: `<text_encoding>` (PR #141312)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 3 20:58:37 PDT 2026


================
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// <text_encoding>
+
+// text_encoding::text_encoding() noexcept
+
+#include <cassert>
+#include <concepts>
+#include <text_encoding>
+#include <type_traits>
+
+constexpr bool test() {
+  std::same_as<std::text_encoding> decltype(auto) te = std::text_encoding();
----------------
frederick-vs-ja wrote:

In contrast to testing `locale::encoding`, I think it's not so meaningful to verity the type sameness, because we're explicitly typing `std::text_encoding` in the initializer.

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


More information about the libcxx-commits mailing list