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 » Proposal: add Vector::InsertPick(int i, pick_ T&)
Re: Proposal: add Vector::InsertPick(int i, pick_ T&) [message #21255 is a reply to message #21246] Sun, 10 May 2009 23:11 Go to previous message
mirek is currently offline  mirek
Messages: 14266
Registered: November 2005
Ultimate Member
hans wrote on Sun, 10 May 2009 13:56

Hi,
I think
template <class T>
void Vector<T>::InsertPick(int i, pick_ T& x)
{
	if(!count) return;
	ASSERT(&x < vector || &x > vector + items);
	RawInsert(q, count);
	::new(vector[q]) T(x);
}

is wrong, should be:

template <class T>
void Vector<T>::InsertPick(int q, pick_ T& x)
{
	ASSERT(&x < vector || &x > vector + items);
	RawInsert(q, 1);
	::new(vector[q]) T(x);
}


Thanks, Hans.


Thank you, you are right, of course.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Incorrect ASSERT in Value::Serialize
Next Topic: XmlParser and <![CDATA[
Goto Forum:
  


Current Time: Fri Jul 18 04:45:04 CEST 2025

Total time taken to generate the page: 0.04120 seconds