3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-01 11:43:47 +01:00
dft_tools/doc/reference/c++/arrays_old/FAQ.rst
Olivier Parcollet f2c7d449cc First commit : triqs libs version 1.0 alpha1
for earlier commits, see TRIQS0.x repository.
2013-07-17 19:24:07 +02:00

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.