Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/utility.h

    r2bf9c37 r3c09d47  
    172172auto filter(Args&&... args) -> decltype(std::copy_if(std::forward<Args>(args)...)) {
    173173  return std::copy_if(std::forward<Args>(args)...);
    174 }
    175 
    176 template <typename E, typename UnaryPredicate, template< typename, typename...> class Container, typename... Args >
    177 void filter( Container< E *, Args... > & container, UnaryPredicate pred, bool doDelete ) {
    178         auto i = begin( container );
    179         while ( i != end( container ) ) {
    180                 auto it = next( i );
    181                 if ( pred( *i ) ) {
    182                         if ( doDelete ) {
    183                                 delete *i;
    184                         } // if
    185                         container.erase( i );
    186                 } // if
    187                 i = it;
    188         } // while
    189174}
    190175
Note: See TracChangeset for help on using the changeset viewer.