[PATCH] D79740: Align mapped_iterator::reference type with mapped_iterator::operator*() return value.
Ivan Kelarev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 11 15:08:00 PDT 2020
ikelarev updated this revision to Diff 263291.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79740/new/
https://reviews.llvm.org/D79740
Files:
llvm/include/llvm/ADT/STLExtras.h
Index: llvm/include/llvm/ADT/STLExtras.h
===================================================================
--- llvm/include/llvm/ADT/STLExtras.h
+++ llvm/include/llvm/ADT/STLExtras.h
@@ -285,12 +285,20 @@
template <typename ItTy, typename FuncTy,
typename FuncReturnTy =
- decltype(std::declval<FuncTy>()(*std::declval<ItTy>()))>
+ decltype(std::declval<FuncTy>()(*std::declval<ItTy>()))>
class mapped_iterator
: public iterator_adaptor_base<
- mapped_iterator<ItTy, FuncTy>, ItTy,
- typename std::iterator_traits<ItTy>::iterator_category,
- typename std::remove_reference<FuncReturnTy>::type> {
+ mapped_iterator<ItTy, FuncTy>, ItTy,
+ typename std::iterator_traits<ItTy>::iterator_category,
+ typename std::remove_reference<FuncReturnTy>::type,
+ typename std::iterator_traits<ItTy>::difference_type,
+ std::conditional_t<
+ std::is_same<
+ typename std::remove_reference<FuncReturnTy>::type,
+ typename std::iterator_traits<ItTy>::value_type>::value,
+ typename std::iterator_traits<ItTy>::pointer,
+ typename std::remove_reference<FuncReturnTy>::type *>,
+ FuncReturnTy> {
public:
mapped_iterator(ItTy U, FuncTy F)
: mapped_iterator::iterator_adaptor_base(std::move(U)), F(std::move(F)) {}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79740.263291.patch
Type: text/x-patch
Size: 1412 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200511/3e23997d/attachment.bin>
More information about the llvm-commits
mailing list