Changes in src/GenPoly/ScopedSet.h [7f1be01:e9b5043]
- File:
-
- 1 edited
-
src/GenPoly/ScopedSet.h (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/ScopedSet.h
r7f1be01 re9b5043 47 47 /// Starts a new scope 48 48 void beginScope() { 49 scopes.emplace_back(); 49 Scope scope; 50 scopes.push_back(scope); 50 51 } 51 52 … … 84 85 iterator findNext( const_iterator &it, const Value &key ) { 85 86 if ( it.i == 0 ) return end(); 86 for ( size_type i = it.i - 1; ; --i ) {87 for ( size_type i = it.i - 1; ; --i ) { 87 88 typename Scope::iterator val = scopes[i].find( key ); 88 89 if ( val != scopes[i].end() ) return iterator( scopes, val, i ); … … 111 112 friend class ScopedSet; 112 113 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; 115 117 116 118 /// Checks if this iterator points to a valid item … … 131 133 } 132 134 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) 134 136 : scopes(&_scopes), it(_it), i(_i) {} 135 137 public: … … 174 176 175 177 private: 176 ScopeList const *scopes;178 scope_list const *scopes; 177 179 wrapped_iterator it; 178 180 size_type i; … … 183 185 public std::iterator< std::bidirectional_iterator_tag, value_type > { 184 186 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; 188 191 189 192 /// Checks if this iterator points to a valid item … … 204 207 } 205 208 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) 207 210 : scopes(&_scopes), it(_it), i(_i) {} 208 211 public: … … 252 255 253 256 private: 254 ScopeList const *scopes;257 scope_list const *scopes; 255 258 wrapped_const_iterator it; 256 259 size_type i;
Note:
See TracChangeset
for help on using the changeset viewer.