
25 Jan
2009
25 Jan
'09
7 a.m.
Steven Watanabe wrote:
You might want to look at Boost.Intrusive, which allows you to avoid the extra copies without adding indirection. http://www.boost.org/doc/html/intrusive/advanced_lookups_insertions.html
Unless I'm reading the documentation wrong, I'd still need some kind of indirection to perform the lookups. That is, I'd have to create a tuple of references to pass to find(). Besides that, creating a pair<const key_type,data_type> would also require a copy if key_type were an ordinary tuple. (Using the my_map[key] = value syntax does this under the hood, too). I'm not very familiar with Boost.Intrusive, so correct me if I'm wrong. - Jim