Functions
test_randomiter.cxx File Reference
#include "WireCellUtil/RandomIter.h"
#include "WireCellUtil/Testing.h"
#include <iostream>
#include <vector>

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

int main ( void  )

Definition at line 9 of file test_randomiter.cxx.

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
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
QTextStream & endl(QTextStream &s)