Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions include/boost/multi_index/detail/ord_index_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ class ordered_index_impl:protected SuperMeta::type
#endif

{
empty_initialize();
empty_initialize(h);
}

ordered_index_impl(
Expand Down Expand Up @@ -754,7 +754,7 @@ class ordered_index_impl:protected SuperMeta::type
#endif

{
empty_initialize();
empty_initialize(h);
}

~ordered_index_impl()
Expand Down Expand Up @@ -1129,14 +1129,16 @@ class ordered_index_impl:protected SuperMeta::type
{return index_node_type::from_impl(header()->right());}

private:
void empty_initialize()
void empty_initialize(){empty_initialize(header());}

static void empty_initialize(index_node_type* h)
{
header()->color()=red;
/* used to distinguish header() from root, in iterator.operator++ */
h->color()=red;
/* used to distinguish header from root, in iterator.operator++ */

header()->parent()=node_impl_pointer(0);
header()->left()=header()->impl();
header()->right()=header()->impl();
h->parent()=node_impl_pointer(0);
h->left()=h->impl();
h->right()=h->impl();
}

struct link_info
Expand Down
10 changes: 6 additions & 4 deletions include/boost/multi_index/sequenced_index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ class sequenced_index:protected SuperMeta::type
#endif

{
empty_initialize();
empty_initialize(h);
}

sequenced_index(
Expand All @@ -692,7 +692,7 @@ class sequenced_index:protected SuperMeta::type
#endif

{
empty_initialize();
empty_initialize(h);
}

~sequenced_index()
Expand Down Expand Up @@ -896,9 +896,11 @@ class sequenced_index:protected SuperMeta::type
private:
index_node_type* header()const{return this->final_header();}

void empty_initialize()
void empty_initialize(){empty_initialize(header());}

static void empty_initialize(index_node_type* h)
{
header()->prior()=header()->next()=header()->impl();
h->prior()=h->next()=h->impl();
}

void link(index_node_type* x)
Expand Down
Loading