#include "Utils/Thread.hpp" namespace Chattr { Thread::Thread(Thread&& other) noexcept { other.detach(); } Thread& Thread::operator=(Thread&& other) noexcept { other.detach(); return *this; } Thread::~Thread() { if (!detached) { spdlog::critical("There is not joined thread"); std::exit(EXIT_FAILURE); } if (returnValuePtr != nullptr) delete returnValuePtr; } void Thread::detach() { detached = true; } }