[PATCH] D51262: Implement P0553 and P0556

Marshall Clow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 24 17:47:48 PDT 2019


mclow.lists marked 4 inline comments as done.
mclow.lists added inline comments.


================
Comment at: include/bit:254
+
+    if      constexpr (sizeof(_Tp) <= sizeof(unsigned int))
+    	return __clz(static_cast<unsigned int>(__t))
----------------
EricWF wrote:
> Cool use of `if constexpr`.
> 
> Please clang-format these changes.
I really like this formatting; it reflects the structure of the code.


================
Comment at: include/bit:405
+
+template <class _Tp>
+inline _LIBCPP_INLINE_VISIBILITY constexpr
----------------
EricWF wrote:
> Please write the SFINAE using a default template parameter.
> 
> See http://libcxx.llvm.org/docs/DesignDocs/ExtendedCXX03Support.html#use-default-template-parameters-for-sfinae
I think that document is misguided in cases like this; the `enable_if` on the return type cannot be "interfered with" by the caller the way an extra template parameter can be.




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

https://reviews.llvm.org/D51262





More information about the cfe-commits mailing list