[libcxx-commits] [libcxx] [libc++][NFC] Refactor __libcpp_datasizeof to be a variable template (PR #87769)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 5 10:38:25 PDT 2024


================
@@ -26,39 +26,38 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-template <class _Tp>
-struct __libcpp_datasizeof {
 #if __has_extension(datasizeof)
-  static const size_t value = __datasizeof(_Tp);
+template <class _Tp>
+inline const size_t __datasizeof_v = __datasizeof(_Tp);
----------------
philnik777 wrote:

It's exactly as much ODR-used as `__libcpp_datasizeof<>::value`. I don't see where the difference is.

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


More information about the libcxx-commits mailing list