Quantcast
Channel: Make a c++ iterator that traverses 2 containers - Stack Overflow
Browsing all 4 articles
Browse latest View live

Answer 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



Answer 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 Article

Answer 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 Article

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 Article
Browsing all 4 articles
Browse latest View live




Latest Images