Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 14261
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: Thu Jun 12 04:17:15 CEST 2025

Total time taken to generate the page: 0.04485 seconds