Iterator.Indirect.tlh 755 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include "Iterator.Base.tlh"
  3. //-----------------------------------------------------------------------------
  4. // Indirect_Iterator
  5. //-----------------------------------------------------------------------------
  6. namespace Iterator
  7. {
  8. template <typename ForIterator, typename deref_type>
  9. class Indirect_Iterator : public ForIterator
  10. {
  11. typedef ForIterator inherited;
  12. public:
  13. using value_type = typename deref_type;
  14. using data_type = typename deref_type;
  15. public:
  16. Indirect_Iterator (inherited Iter) : inherited (Iter)
  17. {
  18. }
  19. public:
  20. inline data_type Current () { return *inherited::Current (); }
  21. inline data_type operator () () { return Current (); }
  22. inline data_type operator * () { return Current (); }
  23. };
  24. };