mirror of
https://github.com/triqs/dft_tools
synced 2024-11-01 11:43:47 +01:00
19 lines
439 B
ReStructuredText
19 lines
439 B
ReStructuredText
|
|
||
|
FAQ
|
||
|
======
|
||
|
|
||
|
Should I use array_view or array & as a return_type of a function ?
|
||
|
----------------------------------------------------------------------
|
||
|
|
||
|
It depends...
|
||
|
|
||
|
* array & is slightly quicker, since creating a view means copying the index systems (lengths and strides)
|
||
|
and a shared_ptr.
|
||
|
* BUT array_view will keep the reference counting.
|
||
|
|
||
|
So except in very critical parts of the code, the recommendation is to return a view.
|
||
|
|
||
|
|
||
|
|
||
|
|