Ignore:
Timestamp:
Jun 2, 2015, 1:59:11 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
4eb1db6
Parents:
b2152e7a
Message:

documentation, reformatting, operator+ for iterators

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/utility.h

    rb2152e7a rd939274  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue May 19 15:34:57 2015
    13 // Update Count     : 3
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Fri May 29 16:17:02 2015
     13// Update Count     : 7
    1414//
    1515
     
    198198}
    199199
     200// it's nice to actually be able to increment iterators by an arbitrary amount
     201template< typename Iterator >
     202Iterator operator+(Iterator i, int inc) {
     203        while ( inc > 0 ) {
     204                ++i;
     205                --inc;
     206        }
     207        return i;
     208}
     209
    200210#endif // _UTILITY_H
    201211
Note: See TracChangeset for help on using the changeset viewer.