sftrabbit / CppPatterns-Patterns

A repository of modern C++ patterns curated by the community.
Creative Commons Zero v1.0 Universal
1.43k stars 223 forks source link

Initiating samples folder for STL containers. Basic operations with the STL stack #47

Closed shikharkohli closed 9 years ago

shikharkohli commented 9 years ago

Starting off with samples about STL containers and how they can be used. I'll submit more samples for containers like maps, vectors, sets, lists et al

sftrabbit commented 9 years ago

Hey, thanks for submitting this - before you write too many of these and put a lot of effort in, I should clarify what a sample should be. What you've provided is more of an example, which shows how std::stack might be used. It would probably be more suited for the std::stack page on cppreference.com. The samples on C++ Samples should look at it from a different angle - answering questions like "How do I solve this common problem in C++?" or "What is the idiomatic way to do such and such?". Sometimes samples do correspond directly to specific library components, but not generally. If you can think of a common task that is solved by using a std::stack, for example, that would be useful.

shikharkohli commented 9 years ago

Thanks, that makes sense.