Esempio n. 1
0
 //-----------------------------------------------------------------------------
    int
    OrderedSet::
    add( OrderedSet const& os_rhs )
    {
        int added = 0;
        std::for_each( os_rhs.cbegin(), os_rhs.cend(),
                       [&] ( OrderedSetBase_t::value_type const& feature )
                       {   int i = this->index(feature) ;
                           if( i != this->not_found ) {
                               this->append(feature);
                               ++added;
                           }
                        }
                     );
        return added;
    }
Esempio n. 2
0
 //-----------------------------------------------------------------------------
    int
    OrderedSet::
    remove( OrderedSet const& os_rhs )
    {
        int removed = 0;
        std::for_each( os_rhs.cbegin(), os_rhs.cend(),
                       [&] ( OrderedSetBase_t::value_type const& feature )
                       {   int i = this->index(feature) ;
                           if( i != this->not_found ) {
                               this->removeAt(i);
                               ++removed;
                           }
                        }
                     );
        return removed;
    }