This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/31970] set<>::iterator vs type-safety
- From: "chris at bubblescope dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jun 2007 08:57:32 -0000
- Subject: [Bug libstdc++/31970] set<>::iterator vs type-safety
- References: <bug-31970-14562@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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