2

It seems that every single high performance and low latency platform I work with use intrusive pointers and containers to manage the lifetime cycle of their objects. Game engines, trading systems, avionics and others.

Intrusive pointers have been available from boost for more than 20 years and intrusive/flat containers are widely available as well (eg google dense hash map).

If C++ is a performance-oriented language, what is the current rationale for the ISO C++ committee to stall or reject all intrusive pointers and containers proposals into a C++ standard even though they are one of the most widely used tools to achieve very low latency?

  • 1
    Probably because no one formally proposed them. – Brian Bi Sep 30 '21 at 18:32
  • 1
    `std::make_shared` does the job without intrusion. This makes reference counter located in same piece of memory as constructed object. – Marek R Sep 30 '21 at 18:32
  • There is a commentary about std::make_shared at P1351R0 item 2.4 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1351r0.html std::shared_ptr must be responsible for allocating shared state. The runtime cost of this allocation can be effectively reduced or eliminated via std::make_shared which combines shared state allocation with controlled object allocation. Nonetheless, managing allocations increases the complexity of std::shared_ptr. Intrusive smart pointers avoid this complexity by deferring allocation to the pointed-to type. –  Sep 30 '21 at 19:46
  • Proposals - I can see: P1351R0, P0468R1 –  Sep 30 '21 at 19:55
  • 1
    Your question is phrased better than your title. The phrase "never allowed" suggests there is something preventing intrusive constructs from getting into the standard. Your question is more neutrally phrased ("never made it into"), with no implications as to why this happened, whether it be an obstacle or a lack of impetus. I recommend sticking with the neutral phrasing (unless you have a reference supporting "not allowed"). – JaMiT Sep 30 '21 at 23:17
  • 2
    While this is certainly an interesting question, I'm inclined to think this is primarily opinion-based. As such, it's more suitable to a discussion forum than a Q&A site. – cigien Sep 30 '21 at 23:23

0 Answers0