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

Home » U++ Library support » U++ Core » The right container
Re: The right container [message #51235 is a reply to message #51180] Sun, 24 February 2019 11:28 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Novo wrote on Sun, 17 February 2019 11:00
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.


dat.Set(23, 12);

Mirek
 
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: Wed Oct 14 12:18:03 GMT+2 2026

Total time taken to generate the page: 0.15346 seconds