Sign in to follow this  

C++: STL container of unique elements?

Recommended Posts

I have a project that says I need to use an array to hold the values of some strings. I can manually check to see if a vector has a value before inserting it, and this is trivial enough to implement, but I thought that maybe there was a container I haven't used before. I am still getting familiar with the language and the STL. I Googled and found a Unique Associative Container, but I don't need to be able to associate keys with something. Is there a container that would only accept new values if the value doesn't exist, or is this something that programmers are expected to handle on their own?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this