This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/31970] set<>::iterator vs type-safety



------- Comment #8 from chris at bubblescope dot net  2007-06-10 08:57 -------
Hmm.. I thought I did have a good example, I had a function that looked like:

template<typename It>
int count_unique(It begin, It end)
{
  set<typename It::value_type> counter(begin, end);
  return counter.size();
}

But, while you might get multiple copies of this function for each iterator
type, the "work parts" (the building of the set and the call to size()) will be
the same regardless of if this is fixed.

The only good example I can come up with would be if someone decided to build
multiple maps of set::iterators, which I've never wanted to do...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31970


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]