[libcxx-commits] [PATCH] D146398: [libcxx] Fix using std::wcout/wcin on Windows with streams configured in wide mode

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Apr 8 09:16:47 PDT 2023


philnik added inline comments.


================
Comment at: libcxx/include/__std_stream:87
+#if defined(_LIBCPP_WIN32API)
+    if constexpr (sizeof(char_type) == sizeof(wchar_t)) {
+        __encoding_ = 1;
----------------
mstorsjo wrote:
> Mordante wrote:
> > `if constexpr` fails before C++17, AFAIK this code should be working in all language modi.
> Yeah, we can’t use it in public headers, but as far as I could see, this header isn’t ever accessed by any public header - it should only be included by the libcxx sources.
> 
> I think it might be fine to leave out the constexpr if you want it out of principle though, I don’t think there was a functional need for it.
Could you move the header to `src/` if it's actually a private one? (in another patch)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146398/new/

https://reviews.llvm.org/D146398



More information about the libcxx-commits mailing list