template<typename RandomAccessIterator, typename T>
class internal::AlignedVectorCopyConstruct< RandomAccessIterator, T >
A class that given a range of memory locations calls the placement-new operator on these memory locations and copy-constructs objects of type T
there.
This class is based on the specialized for loop base class ParallelForLoop in parallel.h whose purpose is the following: When calling a parallel for loop on AlignedVector with apply_to_subranges, it generates different code for every different argument we might choose (as it is templated). This gives a lot of code (e.g. it triples the memory required for compiling the file matrix_free.cc and the final object size is several times larger) which is completely useless. Therefore, this class channels all copy commands through one call to apply_to_subrange for all possible types, which makes the copy operation much cleaner (thanks to a virtual function, whose cost is negligible in this context).
Definition at line 780 of file aligned_vector.h.
template<typename RandomAccessIterator , typename T >
internal::AlignedVectorCopyConstruct< RandomAccessIterator, T >::AlignedVectorCopyConstruct |
( |
RandomAccessIterator |
source_begin, |
|
|
RandomAccessIterator |
source_end, |
|
|
T *const |
destination |
|
) |
| |
|
inline |
Constructor. Issues a parallel call if there are sufficiently many elements, otherwise works in serial. Copies the data from the half-open interval between source_begin
and source_end
to array starting at destination
(by calling the copy constructor with placement new).
The elements from the source array are simply copied via the placement new copy constructor.
Definition at line 796 of file aligned_vector.h.