문제

I realized that c++ list is ordering the entries. Do you know whether there is an unordered list defined in C++? Is there any example?

Thanks

도움이 되었습니까?

해결책

I realized that c++ list is ordering the entries.

This is actually not true.

std::list does not perform any type of ordering, other than preserving the order you specify as you add items.

Note that std::vector also does not reorder, and is more appropriate in many cases if you just need a collection of values which can be stored and retrieved as necessary.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top