First commit.
Some checks failed
Build & Release / Linux-x86_64-Build (push) Successful in 40s
Build & Release / Linux-AARCH64-Build (push) Has been cancelled

This commit is contained in:
2024-01-31 22:28:19 -08:00
commit 1a4a1ecd9c
246 changed files with 42404 additions and 0 deletions

70
include/ehs/Link.h Normal file
View File

@@ -0,0 +1,70 @@
#pragma once
namespace ehs
{
/// Test
template<typename T>
class Link
{
public:
T value;
Link<T> *child;
~Link()
{
delete child;
}
Link()
: value(), child(nullptr)
{
}
Link(const T value, Link* child)
: value(value), child(child)
{
}
Link(const T value)
: value(value), child(nullptr)
{
}
Link(const Link& link)
: value(link.value), child(nullptr)
{
}
Link(Link&& link) noexcept
: value(link.value), child(link.child)
{
link.value = 0;
link.child = nullptr;
}
Link& operator=(const Link& link)
{
if (this == &link)
return *this;
value = link.value;
child = nullptr;
return *this;
}
Link& operator=(Link&& link) noexcept
{
if (this == &link)
return *this;
value = link.value;
child = link.child;
link.value = 0;
link.child = nullptr;
return *this;
}
};
}