|
Boost Users : |
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2007-02-12 12:15:12
On Sunday 11 February 2007 19:15 pm, Timmo Stange wrote:
> Frank Mori Hess wrote:
> >> connect() is O(n) anyways, if you do automatic slot cleanup there.
> >
> > I suppose a binary search would work too, since the list is kept
> > ordered. That would reduce the insertion time when a group is
> > specified to O(log n). Connect for ungrouped slots is already O(1).
>
> You need a container with random access iterators in order for that
> to have the expected complexity.
Okay, I've optimized the Group/GroupCompare support so it doesn't take
linear time to insert a grouped slot anymore. I added a std::map which
maintains a list iterator to the first slot in each group. See the
grouped_list class in thread_safe_signals/detail/slot_groups.hpp.
-- Frank
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