mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
minor docu change
This commit is contained in:
@ -41,7 +41,7 @@ Description
|
|||||||
xferMoveTo() functions can prove useful. An example is transferring
|
xferMoveTo() functions can prove useful. An example is transferring
|
||||||
from a DynamicList to a List. Since the
|
from a DynamicList to a List. Since the
|
||||||
List\<T\>::transfer(List\<T\>&) method could result in some allocated
|
List\<T\>::transfer(List\<T\>&) method could result in some allocated
|
||||||
memory becoming inaccessible, the xferMoveTo() function can be used to
|
memory becoming inaccessible, the xferMoveTo() function should be used to
|
||||||
invoke the correct List\<T\>::transfer(DynamicList\<T\>&) method.
|
invoke the correct List\<T\>::transfer(DynamicList\<T\>&) method.
|
||||||
|
|
||||||
@code
|
@code
|
||||||
@ -50,6 +50,16 @@ Description
|
|||||||
labelList plainLst( xferMoveTo<labelList>(dynLst) );
|
labelList plainLst( xferMoveTo<labelList>(dynLst) );
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
|
Of course, since this example is a very common operation, the
|
||||||
|
DynamicList::xfer() method transfers to a plain List anyhow.
|
||||||
|
It would thus be simpler (and clearer) just to use the following code:
|
||||||
|
|
||||||
|
@code
|
||||||
|
DynamicList<label> dynLst;
|
||||||
|
...
|
||||||
|
labelList plainLst(dynLst.xfer());
|
||||||
|
@endcode
|
||||||
|
|
||||||
SeeAlso
|
SeeAlso
|
||||||
xferCopy, xferCopyTo, xferMove, xferMoveTo, xferTmp
|
xferCopy, xferCopyTo, xferMove, xferMoveTo, xferTmp
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user