
On 8/12/2011 9:46 AM, Eric Niebler wrote:
Sounds like a plan. If you have some initial sketch/notes that you can share, I'd love to get in the same page with you and share some effort to get this going asap.
Here's my thinking:
1) support/ext_/is_segmented.hpp => support/ sequence/intrinsic/ext_/segments.hpp => sequence/intrinsic/ sequence/intrinsic/ext_/size_s.hpp => sequence/intrinsic/detail/ view/ext_/segmented_iterator.hpp => iterator/ view/ext_/segmented_iterator_range.hpp => view/iterator_range/detail/ view/ext_/segmented_begin.hpp => sequence/intrinsic/detail/ view/ext_/segmented_end.hpp => sequence/intrinsic/detail/ view/ext_/segmented_fold_until.hpp => support/
Various supporting implementation details make corresponding moves.
container/ext_/tree.hpp becomes part of the test suite. It is poorly designed and doesn't deserve to be part of Fusion proper.
2) begin, end, size and empty dispatch to their segmented implementations by default.
3) The existing segmented algorithms (find_s, find_if_s, fold_s, for_each_s) just get merged with their non-segmented equivalents.
4) Wait for the dust to settle. Assuming all is looking good, try making joint_view segmented.
5) Use segmented_fold_until to write segmented flavors of as many algorithms as possible.
I can do 1-3. 5 can be a team effort and can begin as soon as everything has found its rightful place.
A word about segmented_fold_until. You call it with a hierarchical data structure, an initial state and a function. It walks the hierarchical structure and calls a function with each non-segmented range, the current state, and the "context". The context is actually the path through the tree to reach the current leaf range. You can pass it to make_segmented_iterator to (duh!) create a segmented iterator. The function that you pass to segmented_fold_until must wrap its returned object in a fusion::result, which contains a compile-time boolean: continue the fold or break. The returned object is the new state.
Thanks, Eric. If I haven't said so already, I think this is a very nice plan. I can definitely help out with 4 & 5. One thing to note though is that the fusion-0x code will fall out of sync once we go through this. I'm CC'ing Christopher. It would be foolish to merge fusion-0x now, in the middle of development, but I think that the 0x code should finally be merged to main as soon as the dust settles (after 3). Then, we can move to 4 and 5 with fusion-0x code in place. Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com