Fix usage of decltype-based result_of in transform_iterator.

Regardless of value categories of a transform_iterator object, its
dereference operator calls m_f as an lvalue. Thus, correct usage of
decltype-based result_of is result_of<const UnaryFunc&(...)>.
This commit is contained in:
morinmorin 2017-09-16 11:51:12 +09:00
parent d058933767
commit c338572735

View File

@ -47,7 +47,11 @@ namespace iterators {
// the function.
typedef typename ia_dflt_help<
Reference
#ifdef BOOST_RESULT_OF_USE_TR1
, result_of<const UnaryFunc(typename std::iterator_traits<Iterator>::reference)>
#else
, result_of<const UnaryFunc&(typename std::iterator_traits<Iterator>::reference)>
#endif
>::type reference;
// To get the default for Value: remove any reference on the