boost intrusive

1. the advantages of intrusive container

(1) Intrusive containers don't allocate memory dynamically. A call to push_back() dosen't lead to a dynamic allocation with new. This is one reason why intrusive containers can improve performance.

(2) Intrusive containers store the original objectss, not copies. After all, they don't allocate memory dynamically. This leads to another advantage: Member functions such as push_back() don't throw exceptions because they neither allocate memory or copy objects.

The advantages are paid for with more complicated code because preconditions must be met to store objects in intrusive containers. You cannot store objects of arbitrary types in intrusive containers.

原文地址:https://www.cnblogs.com/sssblog/p/11025092.html