[libcxx-commits] [PATCH] D65034: [libc++] use constexpr for sizeof comparisons

Alan Somers via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 22 15:02:35 PDT 2019


asomers updated this revision to Diff 211204.
asomers marked an inline comment as done.
asomers added a comment.

- Use __cpp_if_constexpr.


Repository:
  rCXX libc++

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

https://reviews.llvm.org/D65034

Files:
  include/functional


Index: include/functional
===================================================================
--- include/functional
+++ include/functional
@@ -1766,7 +1766,11 @@
         if (__function::__not_null(__f))
         {
             _FunAlloc __af(__a);
-            if (sizeof(_Fun) <= sizeof(__buf_) &&
+            if
+#ifdef __cpp_if_constexpr
+               constexpr
+#endif
+                (sizeof(_Fun) <= sizeof(__buf_) &&
                 is_nothrow_copy_constructible<_Fp>::value &&
                 is_nothrow_copy_constructible<_FunAlloc>::value)
             {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65034.211204.patch
Type: text/x-patch
Size: 573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190722/b2085bb4/attachment.bin>


More information about the libcxx-commits mailing list