test_randomiter.cxx
Go to the documentation of this file.
2 #include "WireCellUtil/Testing.h"
3 
4 #include <iostream>
5 #include <vector>
6 
7 using namespace WireCell;
8 
9 int main()
10 {
11  typedef int value;
12  typedef std::vector<value> container;
13 
14  container array(4);
15  array[0] = 1; array[1] = 2; array[2] = 3; array[3] = 4;
16 
18 
19  iterator beg(array), end(true,array);
20  for (iterator it = beg; it != end; ++it) {
21  std::cout << *it << std::endl;
22  }
23 
24  beg += 2;
25  std::cout << *beg << std::endl;
26  Assert(3 == *beg);
27  beg -= 2;
28  std::cout << *beg << std::endl;
29  Assert(1 == *beg);
30  return 0;
31 }
intermediate_table::iterator iterator
#define Assert
Definition: Testing.h:7
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:72
auto array(Array const &a)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:228
int main()
Definition: Main.h:22
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
QTextStream & endl(QTextStream &s)