mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-08 01:39:36 +00:00
WIP: fix some memaccess-class warnings
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
// ======= 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 )
|
||||
{
|
||||
do
|
||||
{
|
||||
--n;
|
||||
*(dest+n) = *(src+n);
|
||||
} while( n );
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void set( T *dest, T value, size_t n )
|
||||
{
|
||||
do
|
||||
{
|
||||
--n;
|
||||
*(dest+n) = value;
|
||||
} while( n );
|
||||
}
|
||||
}
|
||||
|
||||
#endif //MEMHELPERS_H
|
||||
Reference in New Issue
Block a user