css_enhanced_waf/public/tier1/memhelpers.h

27 lines
472 B
C
Raw Normal View History

2022-11-16 11:28:39 +01:00
// ======= 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++);
2022-11-16 11:28:39 +01:00
}
template<typename T>
inline void set( T *dest, const T& value, size_t n )
2022-11-16 11:28:39 +01:00
{
for(; n; n--)
*(dest++) = value;
2022-11-16 11:28:39 +01:00
}
}
#endif //MEMHELPERS_H