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/value_functor.hpp | 65 ------------------------------------------------ 1 file changed, 65 deletions(-) delete mode 100644 src/DI/value_functor.hpp (limited to 'src/DI/value_functor.hpp') diff --git a/src/DI/value_functor.hpp b/src/DI/value_functor.hpp deleted file mode 100644 index 1553af9..0000000 --- a/src/DI/value_functor.hpp +++ /dev/null @@ -1,65 +0,0 @@ -#pragma once - -#include "DI/interfaces/copyable_functor.hpp" - -#include "DI/copyable_functor.hpp" -#include "DI/extra_concepts.hpp" - -#include -#include - -/** - * Creates a value-type from a copyable functor. - */ -template -class ValueFunctor; - -template -class ValueFunctor -{ - using TargetFunctor = ICopyableFunctor; - -public: - ValueFunctor() noexcept; - - template - requires NotSameAs, ValueFunctor> - // NOLINTNEXTLINE(bugprone-forwarding-reference-overload) - explicit ValueFunctor(Function &&function) - : ValueFunctor(std::forward(function), std::allocator()) - { - } - - template - ValueFunctor(Function &&function, const Allocator &allocator); - - ValueFunctor(const ValueFunctor &val_functor); - - ValueFunctor(ValueFunctor &&val_functor) noexcept; - - ~ValueFunctor(); - - auto operator=(const ValueFunctor &val_functor) noexcept = delete; - - auto operator=(ValueFunctor &&val_functor) noexcept -> ValueFunctor &; - - auto operator=(std::nullptr_t) -> ValueFunctor &; - - auto operator()(Args &&...args) const -> Return; - - explicit operator bool() const noexcept; - - [[nodiscard]] auto target_type() const noexcept -> const std::type_info &; - - template - auto target() const noexcept -> const Target *; - -private: - typename std::aligned_storage<3 * sizeof(void *)>::type _buf{}; - - TargetFunctor *_functor; - - static auto _as_copyable_functor(void *function_ptr) -> TargetFunctor *; -}; - -#include "value_functor.tpp" -- cgit v1.2.3-18-g5258