You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
472 B
26 lines
472 B
// ======= Copyright nillerusr, 2022 ======= |
|
|
|
// Helper аunctions for setting/сopying memory ( specially for non-POD types ) |
|
// FUCK STL |
|
|
|
#ifndef MEMHELPERS_H |
|
#define MEMHELPERS_H |
|
|
|
namespace memutils |
|
{ |
|
template<typename T> |
|
inline void copy( T *dest, const T *src, size_t n ) |
|
{ |
|
for(; n; n--) |
|
*(dest++) = *(src++); |
|
} |
|
|
|
template<typename T> |
|
inline void set( T *dest, const T& value, size_t n ) |
|
{ |
|
for(; n; n--) |
|
*(dest++) = value; |
|
} |
|
} |
|
|
|
#endif //MEMHELPERS_H
|
|
|