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 » Array : swapping element with a pointer
Re: Array : swapping element with a pointer [message #33764 is a reply to message #33757] Sun, 11 September 2011 15:37 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
mdelfede wrote on Sat, 10 September 2011 16:05

Maybe something added to Array class :

void Swap(int i, T*&ptr) { T *tmp = ptr; ptr = vector[i]; vector[i] = tmp; }


I'd need for ArrayMap too... I wonder if it's automatic or not, adding it to Array class.
Will try....

Max



Interesting idea. Not yet sure whether I like it, but maybe this would make it nicer:

T *Replace(int i, T *ptr) { T *tmp = vector[i]; vector[i] = ptr; return tmp; }
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Why this one leaks ?
Next Topic: [SOLVED] String.GetCount with umlaut
Goto Forum:
  


Current Time: Tue Aug 26 18:14:48 CEST 2025

Total time taken to generate the page: 0.05607 seconds