[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 16:44:54 PDT 2020
ikelarev updated this revision to Diff 263305.
ikelarev added a comment.
David, I agree with you regarding the pointer type, it really seems incorrect too. I modified my patch to replace it with FuncReturnTy as well.
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,14 @@
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, FuncReturnTy,
+ 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.263305.patch
Type: text/x-patch
Size: 1088 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200511/aa085dd5/attachment.bin>
More information about the llvm-commits
mailing list