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   |
 |
mirek
Messages: 14261 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
|
|
|
Goto Forum:
Current Time: Tue Jun 17 13:20:22 CEST 2025
Total time taken to generate the page: 0.04780 seconds
|