[libcxx-commits] [PATCH] D106372: [libc++] Avoid triggering warnings for implicit conversion
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jul 22 11:28:43 PDT 2021
ldionne added inline comments.
================
Comment at: libcxx/include/__iterator/advance.h:60-61
class _InputIter, class _Distance,
- class = typename enable_if<is_integral<decltype(_VSTD::__convert_to_integral(declval<_Distance>()))>::value>::type>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 void advance(_InputIter& __i, _Distance __orig_n) {
- typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize;
- _IntegralSize __n = __orig_n;
+ class _IntegralDistance = decltype(_VSTD::__convert_to_integral(declval<_Distance>())),
+ class = _EnableIf<is_integral<_IntegralDistance>::value> >
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14
----------------
Quuxplusone wrote:
> `_IntegralDistance` is used only once. If you want, you could roll these back up into a single parameter
> ```
> class = _EnableIf<is_integral<decltype(_VSTD::__convert_to_integral(declval<_Distance>()))>::value>
> ```
I think I'll leave it as-is, I find it easier to read.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106372/new/
https://reviews.llvm.org/D106372
More information about the libcxx-commits
mailing list