Browsing index pages (4 articles)
↧
Make a c++ iterator that traverses 2 containers
I have a need for a "container" that acts like the following. It has 2 subcontainers, called A and B, and I need to be able to iterate over just A, just B, and A and B combined. I don't want to use...
View ArticleAnswer by anon for Make a c++ iterator that traverses 2 containers
Have one container which stores the value you are interested in together with a flag indicating whether it is in A or B.
View ArticleAnswer by grepsedawk for Make a c++ iterator that traverses 2 containers
I will repost my answer to a similar question. I think this will do what you want.Use a library like Boost.MultiIndex to do what you want. It scales well and there is a lot less boiler plate code if...
View ArticleAnswer by Billy ONeal for Make a c++ iterator that traverses 2 containers
You could also create a single container containing std::pair<> objects.Billy3
View Article
Browsing index pages (4 articles)