Go to the documentation of this file.
26 #ifndef _astro_macros_h
27 #define _astro_macros_h
29 #define FOREACH2j(C, i_, x) for(C i_ = (x).begin(); i_ != (x).end(); ++i_)
30 #define FOREACH2(C, x) FOREACH2j(C, i, x)
32 #define REVEACH2j(C, i_, x) for(C i_ = (x).rbegin(); i_ != (x).rend(); ++i_)
33 #define REVEACH2(C, x) REVEACH2j(C, i, x)
35 #define FOREACHj(i_, x) for(typeof((x).begin()) i_ = (x).begin(); i_ != (x).end(); ++i_)
36 #define FOREACH(x) FOREACHj(i, x)
38 #define REVEACHj(i_, x) for(typeof((x).rbegin()) i_ = (x).rbegin(); i_ != (x).rend(); ++i_)
39 #define REVEACH(x) REVEACHj(i, x)
41 #define FORj(i, i0, i1) for(int i = i0; i != i1; ++i)
42 #define FOR(i0, i1) FORj(i, i0, i1)
44 #define REVj(i, i0, i1) for(int i = i0; i != i1; --i)
45 #define REV(i0, i1) REVj(i, i0, i1)
47 #define OSTREAM(T) std::ostream &operator <<(std::ostream &out, T)
48 #define ISTREAM(T) std::istream &operator >>(std::istream &in, T)
50 #endif // _astro_macros_h