Subject: Re: [boost] [ boost ] [ Trie ]
From: Cosmin Boaca (boost.cosmin.boaca_at_[hidden])
Date: 2015-02-20 15:17:10
I have two observations about the removal of the reverse_iterator.
The trie_reverse_iterator has a methd get_key() which calls the get_key()
method from the base iterator. If std::reverse_iterator is used then this
method can't be accessed anymore. If I remove it there is no way to
retrieve the key of a specific object.
Also, the trie_iterator doesn't act like a standard STL iterator over a
mapped data structure. Those iterators return a pair<Key, Value> when
they're derefferenced. trie_iterator returns only Value.
In order to address the things I have mentioned above, I am thinking at
changing the operators *, and -> from the trie_iterator to return
pair<const std::vector<Key>, Value>. Also, I think about adding a new
member into the trie_iterator class, named current_path, which would
represent the current path in the Trie from the root to the node which the
iterator is pointing to. By doing so, std::reverse_iterator can be used
instead of trie_reverse_iterator and also the key associated with the
current node can be retrieved in better running time.
I would like to know your oppinion about the changes I am proposing.
On 20 February 2015 at 20:21, Cosmin Boaca <boost.cosmin.boaca_at_[hidden]>
> Finally I have managed to run the tests.
> On 20 February 2015 at 18:11, Cosmin Boaca <boost.cosmin.boaca_at_[hidden]>
>> I didn't managed to run the tests on Windows using bjam and also couldn't
>> manage to run any kind of boost test in visual studio. Any test I am trying
>> to run receveies acces violation error .
>> On 20 February 2015 at 11:58, Antony Polukhin <antoshkka_at_[hidden]>
>>> 2015-02-20 13:36 GMT+04:00 Cosmin Boaca <boost.cosmin.boaca_at_[hidden]>:
>>> > However, I do not want do this during GSoC because I won't be available
>>> > during the summer. I want to contribute during my spare time.
>>> This sounds like a killer feature to me :) I'd gladly help you.
>>> As I see, you've already started the work on Trie project by removing the
>>> Compare template parameter from trie_node. That's a good start!
>>> Lets continue the code simplification. Looks like trie_reverse_iterator
>>> could be removed and std::reverse_iterator used instead. This will reduce
>>> the code size and simplify the maintainability.
>>> clear() and destroy() functions almost duplicate each other. Looks like
>>> clear() must work as destroy(), so fix the clear() method and use it
>>> everywhere in code instead of destroy(). Make sure that everything works
>>> well, and tests pass.
>>> In case of trouble or finishing the task - notify me.
>>> Good luck! Hope you'll enjoy the project!
>>> Best regards,
>>> Antony Polukhin
>>> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk