Loading…
CppCon 2021 has ended
• const/Units/Time [clear filter]
Monday, October 25
 

4:45pm MDT

Implementing static_vector: How Hard Could it Be?
static_vector is a std::vector that allocates things on the stack instead of the heap. We have std::vector, so it should be easy to write a non-allocating version, right?

Sadly, it's not quite that simple. There are many aspects of the vector interface that make sense based on a container that can reallocate, but do not make sense for a container that cannot. This leads to some API differences. static_vector also faces certain challenges around constexpr that makes it both more and less constexpr than std::vector.

We will go into detail on how std::vector and how static_vector work, how they are similar, and how they differ. This presentation will be focusing on lower-level details and interactions with specific language features in C++20 and (hopefully) C++23. There will be lots of code examples, and we'll step through how they work and where they fall short, trying to build up to a working, production-ready solution.

Speakers
avatar for David Stone

David Stone

Software Engineer, Quantlab
David Stone has worked on autonomous vehicles, large-scale distributed systems, and now works developing software for high-frequency trading. He is a member of the C++ Standardization Committee, where he chairs the Modules Study Group (SG2) and is the vice chair of the Evolution Working... Read More →


Monday October 25, 2021 4:45pm - 5:45pm MDT
B) Summit 8/9
 
  • Timezone
  • Filter By Date CppCon 2021 Oct 24 -29, 2021
  • Filter By Venue online
  • Filter By Type
  • • Algorithms/Functional
  • • Async/Concurrency/Parallelism
  • • C++20/Future of C++
  • • Code Design
  • • const/Units/Time
  • • Education/Coaching
  • • Embedded
  • • GPU/Graphics
  • • Modules/Libraries
  • • Real-time/Data Science
  • • Software Design
  • • Templates/Concepts
  • • Testing/Error Handling
  • • Tooling/Debugging
  • • Type Design
  • Business
  • Social
  • Access


Filter sessions
Apply filters to sessions.