Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give advice on which STL container to use for which application? #448

Open
hageboeck opened this issue Mar 10, 2023 · 2 comments
Open

Give advice on which STL container to use for which application? #448

hageboeck opened this issue Mar 10, 2023 · 2 comments
Labels
Advanced Content for the "advanced" course stale

Comments

@hageboeck
Copy link
Contributor

We mention containers, but we don't really say when you should use those. Is it wise to discuss this in the advanced course?
Should we even create an exercise, or write something on quickbench that we can show in the slides?

@hageboeck hageboeck added the Advanced Content for the "advanced" course label Mar 10, 2023
@bernhardmgruber
Copy link
Contributor

I would say that most of the interesting containers are actually not in the STL (yet) :) The goto is std::vector. I don't think there are many good cases for std::list etc. We could show a benchmark here, but we could also just tell the students they should not use it :) std::deque is useful if you want iterator and reference stability when resizing, but then we need to discuss this. We could throw in std::array maybe.

More interesting containers in my option would be e.g. boost::static_vector<T, N> , boost::small_vector<T> or boost::circular_buffer. There is also std::hive coming up (a bucket array).

So bottom line: I would not know what to put into such an exercise. We could make a container exercise though, that just uses a bunch of vectors.

Copy link

stale bot commented Mar 9, 2024

This issue or pull request has been automatically marked as stale because it has not had recent activity. Please manually close it, if it is no longer relevant, or ask for help or support to help getting it unstuck. Let me bring this to the attention of @klieret @wdconinc @michmx for now.

@stale stale bot added the stale label Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Advanced Content for the "advanced" course stale
Projects
None yet
Development

No branches or pull requests

2 participants