Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/ScopedSet.h

    r7f1be01 re9b5043  
    4747        /// Starts a new scope
    4848        void beginScope() {
    49                 scopes.emplace_back();
     49                Scope scope;
     50                scopes.push_back(scope);
    5051        }
    5152
     
    8485        iterator findNext( const_iterator &it, const Value &key ) {
    8586                if ( it.i == 0 ) return end();
    86                 for ( size_type i = it.i - 1; ; --i ) {
     87                        for ( size_type i = it.i - 1; ; --i ) {
    8788                        typename Scope::iterator val = scopes[i].find( key );
    8889                        if ( val != scopes[i].end() ) return iterator( scopes, val, i );
     
    111112        friend class ScopedSet;
    112113        friend class const_iterator;
    113         typedef typename Scope::iterator wrapped_iterator;
    114         typedef typename ScopeList::size_type size_type;
     114        typedef typename std::set< Value >::iterator wrapped_iterator;
     115        typedef typename std::vector< std::set< Value > > scope_list;
     116        typedef typename scope_list::size_type size_type;
    115117
    116118        /// Checks if this iterator points to a valid item
     
    131133        }
    132134
    133         iterator(ScopeList const &_scopes, const wrapped_iterator &_it, size_type _i)
     135        iterator(scope_list const &_scopes, const wrapped_iterator &_it, size_type _i)
    134136                : scopes(&_scopes), it(_it), i(_i) {}
    135137public:
     
    174176
    175177private:
    176         ScopeList const *scopes;
     178        scope_list const *scopes;
    177179        wrapped_iterator it;
    178180        size_type i;
     
    183185                public std::iterator< std::bidirectional_iterator_tag, value_type > {
    184186        friend class ScopedSet;
    185         typedef typename Scope::iterator wrapped_iterator;
    186         typedef typename Scope::const_iterator wrapped_const_iterator;
    187         typedef typename ScopeList::size_type size_type;
     187        typedef typename std::set< Value >::iterator wrapped_iterator;
     188        typedef typename std::set< Value >::const_iterator wrapped_const_iterator;
     189        typedef typename std::vector< std::set< Value > > scope_list;
     190        typedef typename scope_list::size_type size_type;
    188191
    189192        /// Checks if this iterator points to a valid item
     
    204207        }
    205208
    206         const_iterator(ScopeList const &_scopes, const wrapped_const_iterator &_it, size_type _i)
     209        const_iterator(scope_list const &_scopes, const wrapped_const_iterator &_it, size_type _i)
    207210                : scopes(&_scopes), it(_it), i(_i) {}
    208211public:
     
    252255
    253256private:
    254         ScopeList const *scopes;
     257        scope_list const *scopes;
    255258        wrapped_const_iterator it;
    256259        size_type i;
Note: See TracChangeset for help on using the changeset viewer.