MCPcopy Create free account
hub / github.com/Kitware/VTK / DoGenericCopy

Method DoGenericCopy

Common/Core/vtkDataArray_DeepCopy.cxx:97–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95 // Generic implementation:
96 template <typename SrcArrayT, typename DstArrayT>
97 void DoGenericCopy(SrcArrayT* src, DstArrayT* dst) const
98 {
99 const auto srcRange = vtk::DataArrayValueRange(src);
100 auto dstRange = vtk::DataArrayValueRange(dst);
101
102 using DstT = typename decltype(dstRange)::ValueType;
103 auto destIter = dstRange.begin();
104 // use for loop instead of copy to avoid -Wconversion warnings
105 for (auto v = srcRange.cbegin(); v != srcRange.cend(); ++v, ++destIter)
106 {
107 *destIter = static_cast<DstT>(*v);
108 }
109 }
110
111 // These overloads are split so that the above specializations will be
112 // used properly.

Callers 1

operator()Method · 0.95

Calls 4

DataArrayValueRangeFunction · 0.85
beginMethod · 0.45
cbeginMethod · 0.45
cendMethod · 0.45

Tested by

no test coverage detected