Files
EGameTools/DL2GameOverhaulScript/source/game/buffer.h
T
EricPlayZ 9c705ef652 - Major code refactor! This means easier option additions and easier code navigation/readability!
- Now using precompiled headers for extremely fast compilation times :D
2024-02-11 06:11:25 +02:00

17 lines
718 B
C++

#pragma once
template<size_t size, typename T> class buffer {
char buffer[size];
T data;
public:
operator T() { return data; }
T operator->() { return data; }
T& operator=(const T& other) { data = other; return data; }
T& operator*=(const T& other) { data *= other; return data; }
T operator*(const T& other) const { return data * other; }
T& operator/=(const T& other) { data /= other; return data; }
T operator/(const T& other) const { return data / other; }
T& operator+=(const T& other) { data += other; return data; }
T operator+(const T& other) const { return data + other; }
T& operator-=(const T& other) { data -= other; return data; }
T operator-(const T& other) const { return data - other; }
};