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 » Vector::SetCount()
Re: Vector::SetCount() [message #19109 is a reply to message #19096] Wed, 12 November 2008 22:09 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14261
Registered: November 2005
Ultimate Member
Are you sure? Do not see anything like that in the code:

template <class T>
void Vector<T>::Trim(int n)
{
	ASSERT(n >= 0 && n <= items);
	DestroyArray(vector + n, vector + items);
	items = n;
}

template <class T>
void Vector<T>::SetCount(int n) {
	Chk();
	ASSERT(n >= 0);
	if(n == items) return;
	if(n < items)
		Trim(n);
	else {
		if(n > alloc) ReAllocF(n);
		ConstructArray(vector + items, vector + n);
		items = n;
	}
}

 
Read Message
Read Message
Read Message
Previous Topic: Win 98
Next Topic: [Solved] Any::dtor fails after it is picked
Goto Forum:
  


Current Time: Wed Jun 18 08:57:10 CEST 2025

Total time taken to generate the page: 0.05256 seconds