kohait00 Messages: 939 Registered: July 2009 Location: Germany
Experienced Contributor
What about doing this as constructor overloads? Perhaps starting with 2 parameters to avoid copy variant. Or is it too ambiguous?
as far as got to know the ValueArray code, it does adding values by adding it to internal Vector<Value> anyway.
doing it like in the example above already provides the prepared Vector<Value> to pick, so no copy is done. and it saves the ValueArray interface from growing and remains optional usage.
ambiguity maybe could be a side effect some day in other occassions.. i consider ValueArray(_pick Vector<Value>&) flexible enough if you ask me..
it'd also be possible to leave it like it is now and simply do
Value v = ValueArray(Vector<Value>() << 123 << "Hallo" << 34.9);
its not so nice, but neither generates extra code in Upp base to manage