mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: cleanup List constructors (issue #725)
- add copy construct from UList
- remove copy construct from dissimilar types.
This templated constructor was too generous in what it accepted.
For the special cases where a copy constructor is required with
a change in the data type, now use the createList factory method,
which accepts a unary operator. Eg,
auto scalars = scalarList::createList
(
labels,
[](const label& val){ return 1.5*val; }
);
This commit is contained in:
@ -1007,7 +1007,11 @@ Foam::label Foam::checkGeometry
|
||||
globalFaces().gather
|
||||
(
|
||||
UPstream::worldComm,
|
||||
labelList(UPstream::procID(UPstream::worldComm)),
|
||||
labelList::createList
|
||||
(
|
||||
UPstream::procID(UPstream::worldComm),
|
||||
toLabel<int>() // int -> label
|
||||
),
|
||||
ami.srcWeightsSum(),
|
||||
mergedWeights
|
||||
);
|
||||
@ -1057,7 +1061,11 @@ Foam::label Foam::checkGeometry
|
||||
globalFaces().gather
|
||||
(
|
||||
UPstream::worldComm,
|
||||
labelList(UPstream::procID(UPstream::worldComm)),
|
||||
labelList::createList
|
||||
(
|
||||
UPstream::procID(UPstream::worldComm),
|
||||
toLabel<int>() // int -> label
|
||||
),
|
||||
ami.tgtWeightsSum(),
|
||||
mergedWeights
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user