mirror of
https://github.com/triqs/dft_tools
synced 2024-11-01 03:33:50 +01:00
f2c7d449cc
for earlier commits, see TRIQS0.x repository.
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.
|
|
|
|
|
|
|
|
|