Changeset db9d7a9


Ignore:
Timestamp:
Feb 3, 2023, 12:24:01 PM (22 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
2125443a
Parents:
85dd381
Message:

Fixed clang++-10 error. One of the problem functions was never used and may not add functionality, it was removed. The other was simply moved, although changing it might be better, that was not working as a quick fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/ScopedMap.h

    r85dd381 rdb9d7a9  
    4646        typedef std::vector< Scope > ScopeList;
    4747
    48         ScopeList scopes; ///< scoped list of maps
     48        /// Scoped list of maps.
     49        ScopeList scopes;
    4950public:
    5051        typedef typename MapType::key_type key_type;
     
    146147        }
    147148
    148         template< typename value_type_t >
    149         std::pair< iterator, bool > insert( iterator at, value_type_t && value ) {
    150                 MapType & scope = (*at.scopes)[ at.level ].map;
    151                 std::pair< typename MapType::iterator, bool > res = scope.insert( std::forward<value_type_t>( value ) );
    152                 return std::make_pair( iterator(scopes, std::move( res.first ), at.level), std::move( res.second ) );
    153         }
    154 
    155149        template< typename value_t >
    156150        std::pair< iterator, bool > insert( const Key & key, value_t && value ) { return insert( std::make_pair( key, std::forward<value_t>( value ) ) ); }
     
    173167        }
    174168
    175         iterator erase( iterator pos ) {
    176                 MapType & scope = (*pos.scopes)[ pos.level ].map;
    177                 const typename iterator::wrapped_iterator & new_it = scope.erase( pos.it );
    178                 iterator it( *pos.scopes, new_it, pos.level );
    179                 return it.next_valid();
    180         }
     169        iterator erase( iterator pos );
    181170
    182171        size_type count( const Key & key ) const {
     
    352341};
    353342
     343template<typename Key, typename Value, typename Note>
     344typename ScopedMap<Key, Value, Note>::iterator
     345                ScopedMap<Key, Value, Note>::erase( iterator pos ) {
     346        MapType & scope = (*pos.scopes)[ pos.level ].map;
     347        const typename iterator::wrapped_iterator & new_it = scope.erase( pos.it );
     348        iterator it( *pos.scopes, new_it, pos.level );
     349        return it.next_valid();
     350}
     351
    354352// Local Variables: //
    355353// tab-width: 4 //
Note: See TracChangeset for help on using the changeset viewer.