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 #21246 is a reply to message #21201] Sun, 10 May 2009 19:56 Go to previous messageGo to previous message
hans is currently offline  hans
Messages: 44
Registered: March 2006
Location: Germany
Member
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.

[Updated on: Sun, 10 May 2009 19:57]

Report message to a moderator

 
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:02:15 CEST 2025

Total time taken to generate the page: 0.00384 seconds