Commit 2a3e7594 authored by Ján Bobot's avatar Ján Bobot Committed by Jakub Klinkovský
Browse files

added begin and end methods to UnorderedIndexedSet

parent cc40d6ac
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -32,6 +32,8 @@ public:
   using index_type = Index;
   using value_type = typename map_type::value_type;
   using size_type = typename map_type::size_type;
   using iterator = typename map_type::iterator;
   using const_iterator = typename map_type::const_iterator;
   using hasher = Hash;
   using key_equal = KeyEqual;
   
@@ -50,6 +52,14 @@ public:
   size_type erase( const Key& key );

   void print( std::ostream& str ) const;

   iterator begin();

   const_iterator begin() const;

   iterator end();

   const_iterator end() const;
};

template< typename Element,
+44 −0
Original line number Diff line number Diff line
@@ -115,6 +115,50 @@ void UnorderedIndexedSet< Key, Index, Hash, KeyEqual, Allocator >::print( std::o
   }
}

template< class Key,
          class Index,
          class Hash,
          class KeyEqual,
          class Allocator >
typename UnorderedIndexedSet< Key, Index, Hash, KeyEqual, Allocator >::iterator
UnorderedIndexedSet< Key, Index, Hash, KeyEqual, Allocator >::begin()
{
   return map.begin();
}

template< class Key,
          class Index,
          class Hash,
          class KeyEqual,
          class Allocator >
typename UnorderedIndexedSet< Key, Index, Hash, KeyEqual, Allocator >::const_iterator
UnorderedIndexedSet< Key, Index, Hash, KeyEqual, Allocator >::begin() const
{
   return map.begin();
}

template< class Key,
          class Index,
          class Hash,
          class KeyEqual,
          class Allocator >
typename UnorderedIndexedSet< Key, Index, Hash, KeyEqual, Allocator >::iterator
UnorderedIndexedSet< Key, Index, Hash, KeyEqual, Allocator >::end()
{
   return map.end();
}

template< class Key,
          class Index,
          class Hash,
          class KeyEqual,
          class Allocator >
typename UnorderedIndexedSet< Key, Index, Hash, KeyEqual, Allocator >::const_iterator
UnorderedIndexedSet< Key, Index, Hash, KeyEqual, Allocator >::end() const
{
   return map.end();
}

template< class Key,
          class Index,
          class Hash,