Ignore:
Timestamp:
Nov 22, 2017, 3:43:50 PM (7 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:
5fe35d6
Parents:
7e4c4f4 (diff), c2c6177 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/typeops.h

    r7e4c4f4 r452747a  
    1616#pragma once
    1717
     18#include <vector>
     19
    1820#include "SynTree/SynTree.h"
    1921#include "SynTree/Type.h"
     
    2830        void combos( InputIterator begin, InputIterator end, OutputIterator out ) {
    2931                typedef typename InputIterator::value_type SetType;
    30                 typedef typename std::list< typename SetType::value_type > ListType;
     32                typedef typename std::vector< typename SetType::value_type > ListType;
    3133
    3234                if ( begin == end )     {
     
    3840                begin++;
    3941
    40                 std::list< ListType > recursiveResult;
     42                std::vector< ListType > recursiveResult;
    4143                combos( begin, end, back_inserter( recursiveResult ) );
    4244
    43                 for ( typename std::list< ListType >::const_iterator i = recursiveResult.begin(); i != recursiveResult.end(); ++i ) {
    44                         for ( typename ListType::const_iterator j = current->begin(); j != current->end(); ++j ) {
    45                                 ListType result;
    46                                 std::back_insert_iterator< ListType > inserter = back_inserter( result );
    47                                 *inserter++ = *j;
    48                                 std::copy( i->begin(), i->end(), inserter );
    49                                 *out++ = result;
    50                         } // for
    51                 } // for
     45                for ( const auto& i : recursiveResult ) for ( const auto& j : *current ) {
     46                        ListType result;
     47                        std::back_insert_iterator< ListType > inserter = back_inserter( result );
     48                        *inserter++ = j;
     49                        std::copy( i.begin(), i.end(), inserter );
     50                        *out++ = result;
     51                }
    5252        }
    5353
Note: See TracChangeset for help on using the changeset viewer.