Started work on Smart Pointer Vectors (SPVs).
This commit is contained in:
26
include/ehs/SPV.h
Normal file
26
include/ehs/SPV.h
Normal 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
25
include/ehs/SPVE.h
Normal 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);
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user