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 » Fixes to Array::Create & Vector::Create
Re: Fixes to Array::Create & Vector::Create [message #49079 is a reply to message #49078] Fri, 15 December 2017 09:44 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13986
Registered: November 2005
Ultimate Member
Unfortunately, this seems not to work:

struct Test {
	Vector<int> a;
	int         b;
	
	Test(Vector<int>&& a, int b) : a(pick(a)), b(b) {}
};

CONSOLE_APP_MAIN
{
	Array<Test> h;
	Vector<int> v;
	v.Add(12);
	h.Create<Test>(v, 22);
	DDUMP(v.GetCount());
	h.Create<Test>(pick(v), 22);
	DDUMP(v.GetCount());
}


Here, I would expect const Args& for the first 'Create' and && for the second one.

For some reason, both end in && overload (I am really not sure why, IMO they should not, but they do with both MSC and GCC).

So unfortunately, to stay safe, I am going to rollback this feature. This has really trivial workaround (default constructor + Set method).

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Performance problem with XmlParser::Next()
Next Topic: how to use xmlparser to parse this document?
Goto Forum:
  


Current Time: Mon Jun 17 17:46:16 CEST 2024

Total time taken to generate the page: 0.03134 seconds