Changeset b8b6c44 for src/GenPoly


Ignore:
Timestamp:
Sep 2, 2018, 10:20:13 AM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
7b10ea9
Parents:
029e330
Message:

Add get_level to ScopedSet?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/ScopedSet.h

    r029e330 rb8b6c44  
    3838                typedef typename Scope::pointer pointer;
    3939                typedef typename Scope::const_pointer const_pointer;
    40                
     40
    4141                class iterator : public std::iterator< std::bidirectional_iterator_tag,
    4242                                                       value_type > {
     
    7272                                return *this;
    7373                        }
    74                        
     74
    7575                        reference operator* () { return *it; }
    7676                        pointer operator-> () { return it.operator->(); }
     
    104104                        bool operator!= (const iterator &that) { return !( *this == that ); }
    105105
     106                        size_type get_level() const { return i; }
     107
    106108                private:
    107109                        scope_list const *scopes;
     
    180182                        bool operator!= (const const_iterator &that) { return !( *this == that ); }
    181183
     184                        size_type get_level() const { return i; }
     185
    182186                private:
    183187                        scope_list const *scopes;
     
    185189                        size_type i;
    186190                };
    187                
     191
    188192                /// Starts a new scope
    189193                void beginScope() {
     
    222226                        return const_iterator( const_cast< ScopedSet< Value >* >(this)->find( key ) );
    223227                }
    224                
     228
    225229                /// Finds the given key in the outermost scope inside the given scope where it occurs
    226230                iterator findNext( const_iterator &it, const Value &key ) {
     
    242246                        return std::make_pair( iterator(scopes, res.first, scopes.size()-1), res.second );
    243247                }
    244                
     248
    245249        };
    246250} // namespace GenPoly
Note: See TracChangeset for help on using the changeset viewer.