Skip to content
  • Mark OLESEN's avatar
    ENH: add some standard templates and macros into stdFoam.H · c65e2e58
    Mark OLESEN authored
    - some functionality similar to what the standary library <iterator>
      provides.
    
      * stdFoam::begin() and stdFoam::end() do type deduction,
        which means that many cases it is possible to manage these types
        of changes.
    
        For example, when managing a number of indices:
           Map<labelHashSet> lookup;
    
        1) Longhand:
    
            for
            (
                Map<labelHashSet>::const_iterator iter = lookup.begin();
                iter != lookup.end();
                ++iter
            )
            { .... }
    
        1b) The same, but wrapped via a macro:
    
            forAllConstIter(Map<labelHashSet>, lookup, iter)
            { .... }
    
        2) Using stdFoam begin/end templates directly
    
            for
            (
                auto iter = stdFoam::begin(lookup);
                iter != stdFoam::end(lookup);
                ++iter
            )
            { .... }
    
        2b) The same, but wrapped via a macro:
    
            forAllConstIters(lookup, iter)
            { .... }
    
    Note that in many cases it i...
    c65e2e58