Started work on Smart Pointer Vectors (SPVs).

This commit is contained in:
2024-12-02 16:19:50 -08:00
parent 7bc4b9977d
commit 32f91ead4e
5 changed files with 61 additions and 0 deletions

26
include/ehs/SPV.h Normal file
View File

@@ -0,0 +1,26 @@
#pragma once
#include "Types.h"
namespace ehs
{
template <typename T>
class SPVE;
template <typename T>
class SPV
{
private:
Size size;
Size rawSize;
Size stride;
T *data;
public:
SPV();
SPVE<T> operator[](Size index)
{
return SPVE<T>(data[index]);
}
};
}

25
include/ehs/SPVE.h Normal file
View File

@@ -0,0 +1,25 @@
#pragma once
namespace ehs
{
template <typename T>
class SPVE
{
private:
SPV *owner;
T *value;
public:
SPVE();
SPVE(T *value);
SPVE(SPVE &&spve) noexcept;
SPVE(const SPVE &spve);
SPVE &operator=(SPVE &&spve) noexcept;
SPVE &operator=(const SPVE &spve);
};
}