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 message Go to previous message](theme/default/images/up.png) ![Go to next message Go to previous message](theme/default/images/down.png) |
![](https://www.ultimatepp.org/forums/images/custom_avatars/3.png) |
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
|
|
|
Goto Forum:
Current Time: Mon Jun 17 17:46:16 CEST 2024
Total time taken to generate the page: 0.03134 seconds
|