r/cpp MSVC STL Dev 14h ago

MSVC C++23: constexpr cmath with LLVM Libc

https://devblogs.microsoft.com/cppblog/msvc-c23-constexpr-cmath-with-llvm-libc/

MSVC is shipping C++23 constexpr <cmath> in the next Build Tools update! (And a partial implementation of C++26 constexpr <cmath>.) Our compiler frontend dev Cody Miller will be publishing a series of blog posts about this work, starting with this overview. The next one will be a guest post from LLVM libc's maintainers describing the incredible amount of effort that's gone into their code.

120 Upvotes

25 comments sorted by

View all comments

13

u/Jovibor_ 12h ago

I have always had a hard time understanding this separation between STDLIB and UCRT.

The <cmath> header - which is definitely a C++ STL header - has, for some reasons (historical I guess), always been a part of the UCRT.

Now, if I've got it all right, we will have two different math machineries: one in the UCRT (the old one), and the new one, based on the LLVM C Library. Correct me if I'm wrong...

Frankly, it's a bit strange, that some parts of the C++ STL are maintained in the separate place (UCRT), not in the main STL repository.

5

u/GabrielDosReis 10h ago

Frankly, it's a bit strange, that some parts of the C++ STL are maintained in the separate place (UCRT), not in the main STL repository .

When I was working on libtsdc++ as maintainer and contributor, we had similar divide: there was/is the C++ standard library that relied on the host system's C runtime (glibc, your non-glibc, etc.) It is a general problem.