ArrayRef: Replace fromVector with subArray
commit6082e4a1a09bbb19a8eb3c06e359394ed3baf1a7
authorRoland Schulz <roland.schulz@intel.com>
Fri, 13 Oct 2017 18:49:46 +0000 (13 11:49 -0700)
committerMark Abraham <mark.j.abraham@gmail.com>
Mon, 30 Oct 2017 13:51:12 +0000 (30 14:51 +0100)
treedc8b9f79094096d18802c64f488e2fb1f4e1e2c9
parent6d6a726eb453573a34b476f1240c8029ff5aadef
ArrayRef: Replace fromVector with subArray

Creating ArrayRef from iterators is potentially dangerous,
because it is incorrect for non-contiguous containers.

arrayRefFromVector(v.begin()+start, v.begin()+start+length)
is replaced with
ArrayRef<T>(v).subArray(start, length)

Also:
- Combine all conversion constructors
  Removes code duplication and makes conversion more powerful
  (e.g. base pointer or containers with allocators).
- remove fromPointers and arrayRefFromPointers
  Wasn't used by any code
- remove fromArray and replace wih arrayRefFromArray

Change-Id: I05ad6b285ece58739d9f5bce48f9ecf4ade3454e
13 files changed:
src/gromacs/analysisdata/arraydata.cpp
src/gromacs/analysisdata/dataframe.cpp
src/gromacs/analysisdata/datastorage.cpp
src/gromacs/analysisdata/framelocaldata.h
src/gromacs/ewald/tests/pmegathertest.cpp
src/gromacs/ewald/tests/pmesplinespreadtest.cpp
src/gromacs/ewald/tests/pmetestcommon.cpp
src/gromacs/mdlib/simulationsignal.cpp
src/gromacs/options/valuestore.h
src/gromacs/selection/selection.h
src/gromacs/selection/tests/nbsearch.cpp
src/gromacs/utility/arrayref.h
src/gromacs/utility/tests/arrayref.cpp