[libcxx-commits] [libcxx] [libcxxabi] [llvm] [libc++] Make variables in templates inline (PR #115785)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 12 09:21:55 PST 2024


philnik777 wrote:

> Can you provide a bit more context around this change? These variables are not marked `inline` in the spec AFAICT. Is this just to allow defining them inside the classes and avoiding a bunch of verbose declarations?

The variables are all `constexpr`, which implies `inline`. Since they aren't `constexpr` in C++03 they're also not `inline` there. Because of that we define them out-of-line currently. Instead we can use the C++17 (?) extension of `inline` variables, which results in the same weak definitions of the variables but without having all the boilerplate.


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


More information about the libcxx-commits mailing list