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 » Preferred way to access VectorMap
Re: Preferred way to access VectorMap [message #35041 is a reply to message #35040] Sun, 01 January 2012 18:47 Go to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
dolik.rce wrote on Sun, 01 January 2012 17:57

Hi Luigi,

First of all, beware that each of those two methods does something else:
VectorMap<K = int,T = myclass> {
	T&       Get(const K& k)                     { return value[Find(k)]; }
	T&       operator[](int i)                     { return value[i]; }
}




Hi Honza,

Thank you for the info.
You are right about the warning and the differences. However in my case I forced the key 'i' to be in the same place of [i]. But in principle this is not the case.
So I am going to use the reference Smile

Best Wishes,
Luigi
 
Read Message
Read Message
Read Message
Previous Topic: Small fix for Find in Algo.h
Next Topic: Date& operator++
Goto Forum:
  


Current Time: Fri May 17 01:58:43 CEST 2024

Total time taken to generate the page: 0.01777 seconds