Boost Users :
Subject: [Boost-users] [multi_index and flyweight]
From: Samuel Charron (samuel.charron_at_[hidden])
Date: 2009-12-04 09:41:54
I'm currently facing some limitations from flyweight and multi_index.
Let's begin with multi_index:
I'd want to have a multi_index storing containers, and have one index
based on all the contained elements.
two vectors [1 2 3] and [3 4] would be indexed as
1 -> [1 2 3]
2 -> [1 2 3]
3 -> [1 2 3] [3 4]
4 -> [3 4]
How would you do that ?
I'd like to have a scoped flyweight, without tracking, i.e.:
... // create some elements
// All elements are deleted when leaving the scope.
However, currently I didn't see a method to clear the internal container.
One way I could do that would be copying - pasting the hashed_factory
and adding a clear method.
It would be easier to extend the class, just having the private
container be protected.
Would that be possible to do one a future release ?
Or is there another easy way to do so ?
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net