src/work/marci/for_each_macros.h
changeset 428 3544872b38c2
parent 333 e0a80761dfd9
child 636 e59b0c363a9e
equal deleted inserted replaced
1:3eb5eb047e15 2:bcf7468e41b4
     2 #ifndef FOR_EACH_MACROS_H
     2 #ifndef FOR_EACH_MACROS_H
     3 #define FOR_EACH_MACROS_H
     3 #define FOR_EACH_MACROS_H
     4 
     4 
     5 namespace hugo {
     5 namespace hugo {
     6 
     6 
     7 #define FOR_EACH(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
     7 #define FOR_EACH_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
     8 #define FOR_EACH_INC(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
     8 #define FOR_EACH_INC_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
     9 
     9 
    10 #define FOR_EACH_EDGE(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
    10 #define FOR_EACH_EDGE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
    11 #define FOR_EACH_NODE(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
    11 #define FOR_EACH_NODE_GLOB(e, g) for((g).first((e)); (g).valid((e)); (g).next((e)))
    12 #define FOR_EACH_INEDGE(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
    12 #define FOR_EACH_INEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
    13 #define FOR_EACH_OUTEDGE(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
    13 #define FOR_EACH_OUTEDGE_GLOB(e, g, v) for((g).first((e), (v)); (g).valid((e)); (g).next((e)))
    14 
    14 
    15 //   template<typename It, typename Graph> 
    15 //   template<typename It, typename Graph> 
    16 //   It loopFirst(const Graph& g) const {
    16 //   It loopFirst(const Graph& g) const {
    17 //     It e; g.first(e); return e; 
    17 //     It e; g.first(e); return e; 
    18 //   }
    18 //   }