Questions tagged [intrusive-containers]

50 questions
17
votes
2 answers

C++ STL Containers are unusable without exceptions, what can we do about this?

The supposed ethos of C++ is "what you use, you pay for". However, this can be quite debilitating due to exceptions and their pervasive use in the STL. Before anybody says "just turn exceptions on", life is not so generous with the programming…
user1290696
  • 489
  • 1
  • 4
  • 10
16
votes
3 answers

C++ CRTP and accessing derived's nested typedefs from base

edit: I'll put a github link here when I am done altering my design for anyone who is interested. Background I'm replacing a boost::intrusive, intrusive_set, with my own implementation as 64-bit compiled intrusive-set stuffs 3 x 8-byte pointers into…
Hassan Syed
  • 20,075
  • 11
  • 87
  • 171
11
votes
2 answers

Boost.Intrusive and unordered_map

I am looking to use an intrusive unordered_map. For some reason there is only an unordered_set in the library. There is also an intrusive hashtable but I'm not sure it has the same functunality, also it doesn't have the same interface. Am I wrong…
the_drow
  • 18,571
  • 25
  • 126
  • 193
7
votes
3 answers

Boost Intrusive List hook

What is the difference in a base hook and a member hook in Boost::Intrusive library and when is one better to use then the other? I've read the boost documentation, but its not that explanatory.
Tony The Lion
  • 61,704
  • 67
  • 242
  • 415
7
votes
3 answers

Why can't intrusive_ptr and shared_ptr be used with boost::intrusive containers?

The boost::intrusive documentation describes how you can use smart pointers with intrusive containers but then says you can't use the smart pointers you'd be most likely to use, "It must have the same ownership semantics as a raw pointer. This means…
Joseph Garvin
  • 20,727
  • 18
  • 94
  • 165
4
votes
6 answers

How to make an intrusive tree class in C# use generics?

In C# I have an intrusive tree structure that looks like this: public abstract class Node { Container parent; Node nextNode; Node previousNode; public abstract class Container : Node { Node firstChild; Node…
Andrew Russell
  • 26,924
  • 7
  • 58
  • 104
4
votes
2 answers

Why isn't there boost::intrusive::map?

The boost documentation (http://www.boost.org/doc/libs/1_55_0/doc/html/intrusive.html) states that the intrusive containers are implemented for list (both single/double linked), set and multiset. I couldn't find an implementation for the map. Is…
kovarex
  • 1,766
  • 18
  • 34
4
votes
1 answer

std::forward_list -- erasing with a stored iterator

I'm trying to keep a global list of a particular (base) class's instances so that I can track them down by iterating through this global list at any time. I believe the most proper way to address this is with an intrusive list. I have heard that…
Steven Lu
  • 41,389
  • 58
  • 210
  • 364
3
votes
3 answers

Memory Alignment warning with gcc

I'm trying to implement a polymorphic data structure e.g. an intrusive linked list (I already know the kernel has one - this is more of learning experience). The trouble is casting a nested struct to the containing struct leads to gcc issuing a…
3
votes
4 answers

What is the advantage of embedding a linked list into a data structure?

While reading about kernel data structures in FreeBSD, I stumbled on the MBuf. The MBuf contains a pointer to the next MBuf in a chain of MBuf's, implementing a linked list. Each MBuf itself also contains data specific to that node in the linked…
Bryan Porter
  • 1,585
  • 2
  • 10
  • 18
3
votes
2 answers

Member hooks versus base hooks in intrusive data structures

I'm coding an intrusive data structure and wondering whether to use base or member hooks. As the code will be called many times, my question regards performance and to what extent the compilers are able to inline such code. Base hooks are based on…
dtldarek
  • 949
  • 1
  • 13
  • 17
3
votes
1 answer

Boost Intrusive unordered_set broken in 1.48 with GCC in C++11 mode

Boost Intrusive's unordered_set is broken if you do a vanilla install of Fedora 17 which comes with GCC 4.7 and Boost 1.48, and use C++11 mode. On Fedora 16, which comes with GCC 4.6.2 and Boost 1.47, it works. This breaks real code, and it even…
John Zwinck
  • 239,568
  • 38
  • 324
  • 436
2
votes
0 answers

Missing merge and split for boost AVL trees?

Boost provides boost::container::set/map/multiset/multimap where the underlying binary-search-tree (BST) can be configured, and it can be chosen to be an AVL tree. One (maybe the most crucial one) reason, why one would prefer AVL trees over…
Vahagn
  • 4,670
  • 9
  • 43
  • 72
2
votes
1 answer

Do Intrusive containers still have performance advantages over non-intrusive ones in modern C++?

Do Boost.Intrusive containers still have performance advantages over non-intrusive standard (std::) ones in the modern C++ (with move semantic, emplace_back, etc)?
Gluttton
  • 5,739
  • 3
  • 31
  • 58
2
votes
1 answer

An intrusive list of unique_ptrs?

I have a program that is highly multi-threaded and it contains an intrusive linked list of objects. I need to pass off the objects in this list to several threads, but only 1 thread will ever own the object at a time, meaning that I don't need this…
Tony The Lion
  • 61,704
  • 67
  • 242
  • 415
1
2 3 4