Re: Iterator over a map of generic vectors.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Eric,

Can you specify your generic function like this (caveat:  not compiled or
tested, off the cuff):

template <typename T>
void function(T begin, T end)
{
  for(T i = begin; i != end; ++i)
  {
    // Do something.
  }
}

And call the template function something like this:

void TestFunction()
{
  map<int, vector<Foo> > container;
  // Add some items into the container.
  function(container.begin(), container.end());
}

--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux