From 40d02748924aa7c48b04cf948204d8dacdfbbc74 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 30 Apr 2022 16:28:13 +0200 Subject: refactor: replace DI files with the yacppdic library --- src/DI/alloc_functor.hpp | 84 ------------------------------------------------ 1 file changed, 84 deletions(-) delete mode 100644 src/DI/alloc_functor.hpp (limited to 'src/DI/alloc_functor.hpp') diff --git a/src/DI/alloc_functor.hpp b/src/DI/alloc_functor.hpp deleted file mode 100644 index ea40b22..0000000 --- a/src/DI/alloc_functor.hpp +++ /dev/null @@ -1,84 +0,0 @@ -#pragma once - -#include "DI/allocation.hpp" -#include "DI/compressed_pair.hpp" - -#include -#include -#include - -template -struct InvokeReturnWrapper -{ - template - static auto call(Args &&...args) -> Return; -}; - -/** - * Holds a functor and a allocator. - */ -template -class AllocFunctor; - -template -class AllocFunctor -{ -public: - using Target = Function; - using Alloc = Allocator; - - explicit AllocFunctor(Target &&function); - - explicit AllocFunctor(const Target &function, const Alloc &allocator); - - explicit AllocFunctor(const Target &function, Alloc &&allocator); - - explicit AllocFunctor(Target &&function, Alloc &&allocator); - - auto operator()(Args &&...args) -> Return; - - [[nodiscard]] auto target() const -> const Target &; - - [[nodiscard]] auto get_allocator() const -> const Alloc &; - - [[nodiscard]] auto clone() const -> AllocFunctor *; - - void destroy() noexcept; - - static void destroy_and_delete(AllocFunctor *functor); - -private: - CompressedPair _function; -}; - -/** - * Holds a functor and a allocator. - */ -template -class DefaultAllocFunctor; - -template -class DefaultAllocFunctor -{ -public: - using Target = Function; - - explicit DefaultAllocFunctor(Target &&function); - - explicit DefaultAllocFunctor(const Target &function); - - auto operator()(Args &&...args) -> Return; - - auto target() const -> const Target &; - - auto clone() const -> DefaultAllocFunctor *; - - void destroy() noexcept; - - static void destroy_and_delete(DefaultAllocFunctor *function); - -private: - Function _function; -}; - -#include "alloc_functor.tpp" -- cgit v1.2.3-18-g5258