[libcxx-commits] [PATCH] D106372: [libc++] Avoid triggering warnings for implicit conversion

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 21 07:53:02 PDT 2021


Quuxplusone added a comment.

LGTM at this point if buildkite is happy (which it seems it's not, yet).
If you think the `advance` stuff needs more thought/discussion, then feel free to ship the hash and tuple pieces, which seem utterly non-controversial, just to get them out of the way.



================
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
----------------
`_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>
```


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