Expression Templates Library (ETL)
memory.hpp
Go to the documentation of this file.
1 //=======================================================================
2 // Copyright (c) 2014-2023 Baptiste Wicht
3 // Distributed under the terms of the MIT License.
4 // (See accompanying file LICENSE or copy at
5 // http://opensource.org/licenses/MIT)
6 //=======================================================================
7 
13 #pragma once
14 
15 namespace etl {
16 
23 template <typename S, typename T>
24 void direct_copy(const S* first, const S* last, T* target) {
25  std::copy(first, last, target);
26 }
27 
34 template <typename S, typename T>
35 void direct_copy_n(const S* source, T* target, size_t n) {
36  std::copy_n(source, n, target);
37 }
38 
45 template <typename S, typename T>
46 void direct_fill(S* first, S* last, T value) {
47  std::fill(first, last, value);
48 }
49 
56 template <typename S, typename T>
57 void direct_fill_n(S* first, size_t n, T value) {
58  std::fill_n(first, n, value);
59 }
60 
61 } //end of namespace etl
void direct_copy(const S *first, const S *last, T *target)
Performs a direct memory copy.
Definition: memory.hpp:24
Root namespace for the ETL library.
Definition: adapter.hpp:15
void direct_fill(E &&mat, V value)
Fill the given ETL value class with the given value.
Definition: direct_fill.hpp:25
void direct_copy_n(const S *source, T *target, size_t n)
Performs a direct memory copy.
Definition: memory.hpp:35
void direct_fill_n(S *first, size_t n, T value)
Fills the given memory with the given value.
Definition: memory.hpp:57