U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » The right container
Re: The right container [message #51180 is a reply to message #51179] Sun, 17 February 2019 11:00 Go to previous messageGo to previous message
Novo is currently offline  Novo
Messages: 1431
Registered: December 2006
Ultimate Contributor
koldo wrote on Sun, 17 February 2019 04:35
Thank you Novo. But I want to save one data, not two.

In this case
dat[23] = 12;

won't work.

An one-value alternative is Index<int>, but you will be unable to write the code line above.
If your range of indices is small and sparse, you can just use regular Vector.
Another approach is to store data in a Vector and sort it, after that you will be able to use algorithms on sorted ranges.

Hope this helps.


Regards,
Novo
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Why there is no Index::Add(T&&)?
Next Topic: [SOLVED] Purpose of HttpRequest::SSLCertificate
Goto Forum:
  


Current Time: Sun May 24 05:29:17 GMT+2 2026

Total time taken to generate the page: 0.00523 seconds