20 #ifndef TILEDARRAY_TRANSFORM_ITERATOR_H__INCLUDED 21 #define TILEDARRAY_TRANSFORM_ITERATOR_H__INCLUDED 44 PointerProxy(
const T& value) : value_(value) { }
49 T* operator->()
const {
return &value_; }
52 operator T*()
const {
return &value_; }
69 template <
typename Iter1,
typename Iter2,
typename Op>
73 template <
typename,
typename,
typename>
78 typedef typename madness::detail::result_of<Op>::type
value_type;
92 it1_(it1), it2_(it2), op_(op)
99 it1_(other.it1_), it2_(other.it2_), op_(other.op_)
112 template <
typename It1,
typename It2>
114 it1_(other.it1_), it2_(other.it2_), op_(other.op_)
139 template <
typename It1,
typename It2>
174 template <
typename It1,
typename It2>
188 template <
typename It1,
typename It2>
190 return ! equal(other);
215 void increment() { ++it1_; ++it2_; }
226 template <
typename It1,
typename It2>
227 bool equal(
const BinaryTransformIterator<It1, It2, Op>& other)
const {
228 return (it1_ == other.it1_) && (it2_ == other.it2_);
234 reference dereference()
const {
return op_(*it1_, *it2_); }
249 template <
typename Iter,
typename Op>
253 template <
typename,
typename>
258 typedef typename madness::detail::result_of<Op>::type
value_type;
277 it_(other.it_), op_(other.op_)
288 template <
typename It>
290 it_(other.it_), op_(other.op_)
312 template <
typename It>
344 template <
typename It>
356 template <
typename It>
358 return ! equal(other);
380 void increment() { ++it_; }
389 template <
typename It>
390 bool equal(
const UnaryTransformIterator<It, Op>& other)
const {
391 return it_ == other.it_;
397 template <
typename It>
398 typename std::enable_if<! std::is_integral<It>::value,
reference>::type
399 dereference(It it)
const {
return op_(*it); }
405 template <
typename It>
406 typename std::enable_if<std::is_integral<It>::value,
reference>::type
407 dereference(It it)
const {
return op_(it); }
423 template <
typename Iter1,
typename Iter2,
typename Op>
435 template <
typename Iter,
typename Op>
443 #endif // TILEDARRAY_TRANSFORM_ITERATOR_H__INCLUDED
BinaryTransformIterator< Iter1, Iter2, Op > make_tran_it(Iter1 it1, Iter2 it2, Op op)
Binary Transform iterator factory.