remove/deprecate construct list from two iterators
There are different two-parameter forms when constructing a List
, notably these:
List(const label len, const T& val);
List(const UList<T>& list, const labelUList& indices);
template<class InputIterator>
List(InputIterator begIter, InputIterator endIter)
This typically causes compilation issues with 64-bit labels, eg,
bad: labelList test(5, 0);
good: labelList test(label(5), 0);
good: labelList test(5, Zero);
otherwise the two-iterator constructor masks everything. In the past, this has prompted both the removal (c43b78e8) and the reinstatement (d01eb45c) of this constructor, even if the problem was never resolved.
Although we generally deal with the problem by properly casting the arguments, still cannot unmask the mapping constructor. For example,
labelList allValues = ...;
labelList indices = ...;
labelList myValues(allValues, indices); -> Error bad iterator pair!!
Although this mapping lookup works with Field and most other types of List, it will not work for a labelList
.
This leads to this type of code:
callFunction(labelList(UIndirectList<label>(allValues, indices)));
vs
callFunction(labelList(allValues, indices));
Propose once again removing the construct from iterator pair and/or replace with a tagged version. For example,
template<class InputIterator>
List(std::piecewise_construct, InputIterator begIter, InputIterator endIter)
Open to suggestions for better dispatch tags.