Changeset 3c13c03 for src/Common


Ignore:
Timestamp:
Sep 17, 2016, 8:27:51 AM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
8c49c0e
Parents:
12bc63a
Message:

expand TupleExpr? and TupleIndexExpr?, add UniqueExpr?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/utility.h

    r12bc63a r3c13c03  
    158158}
    159159
     160// replace element of list with all elements of another list
    160161template< typename T >
    161162void replace( std::list< T > &org, typename std::list< T >::iterator pos, std::list< T > &with ) {
     
    168169
    169170        return;
     171}
     172
     173// replace range of a list with a single element
     174template< typename T >
     175void replace( std::list< T > &org, typename std::list< T >::iterator begin, typename std::list< T >::iterator end, const T & with ) {
     176        org.insert( begin, with );
     177        org.erase( begin, end );
    170178}
    171179
Note: See TracChangeset for help on using the changeset viewer.