Sky Shaver

Sky Shaver

Search
Skip to content
  • Bio

std::stack is an adapter

January 14, 2021 skyshaver

std::stack is an adapter for other containers, by default it uses std::deque but you can pass other containers as a template argument. For example a simple benchmark of using std::vector vs. std::deque as the underlying container with some pushes and pops
https://quick-bench.com/q/3fPcSphHjnWh5uq9ZYvhBvMjl8A

C++

Post navigation

Previous Postdefault doesn’t guarantee creationNext Postchaining emplace_back

programming, mostly C++, some other stuff

Recent Posts

  • [Swift] create an array of a repeated range
  • Dynamic stride in a matrix (1d mimics 2d)
  • Print unique values 6 ways
  • Structured bindings with simple aggregates
  • Simple variadic constructor template
  • chaining emplace_back
  • std::stack is an adapter
  • default doesn’t guarantee creation
  • std::string functions for parsing lines
Proudly powered by WordPress