Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

STL Container that preserves order of insertion but allows no duplicates [duplicate]

Tags:

c++

stl

Possible Duplicate:
A std::map that keep track of the order of insertion?

I am looking for an STL container that preserves order of insertion ( no sorting ) but does not allow duplicates. Is there one? if not any tricks I can use to customize one?

like image 662
krisostofa Avatar asked Jun 08 '11 12:06

krisostofa


1 Answers

There is no such a container at the moment, but you can create your own one in a cheap way by holding a std::vector and a std::set in a class together.

like image 192
Vlad Avatar answered Sep 30 '22 15:09

Vlad