diff options
author | HampusM <hampus@hampusmat.com> | 2022-05-16 22:35:30 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-05-16 22:35:30 +0200 |
commit | 7ab695fe570f842ebdff6b6cb80fa643f17a828b (patch) | |
tree | 69f5ceb9a9086170868426c99d6227d088239ac1 /include/yacppdic/detail/internal/functor/copyable_functor.hpp | |
parent | 3957dfb9361e864f6362e59655c885f52b39371f (diff) |
refactor: clean up factory & related internal components
Diffstat (limited to 'include/yacppdic/detail/internal/functor/copyable_functor.hpp')
-rw-r--r-- | include/yacppdic/detail/internal/functor/copyable_functor.hpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/include/yacppdic/detail/internal/functor/copyable_functor.hpp b/include/yacppdic/detail/internal/functor/copyable_functor.hpp index b305d38..3350781 100644 --- a/include/yacppdic/detail/internal/functor/copyable_functor.hpp +++ b/include/yacppdic/detail/internal/functor/copyable_functor.hpp @@ -15,24 +15,27 @@ namespace yacppdic::internal template <class Function, class Allocator, class FunctionSignature> class CopyableFunctor; -template <class Function, class Allocator, class Return, class... Args> -class CopyableFunctor<Function, Allocator, Return(Args...)> - : public ICopyableFunctor<Return(Args...)> +template <class Function, class Allocator, class Return, class... Params> +class CopyableFunctor<Function, Allocator, Return(Params...)> + : public ICopyableFunctor<Return(Params...)> { public: - explicit CopyableFunctor(Function &&function); + explicit CopyableFunctor(Function &&function) noexcept; - explicit CopyableFunctor(const Function &function, const Allocator &allocator); + explicit CopyableFunctor( + const Function &function, + const Allocator &allocator + ) noexcept; - explicit CopyableFunctor(const Function &function, Allocator &&allocator); + explicit CopyableFunctor(const Function &function, Allocator &&allocator) noexcept; - explicit CopyableFunctor(Function &&function, Allocator &&allocator); + explicit CopyableFunctor(Function &&function, Allocator &&allocator) noexcept; - auto operator()(Args &&...args) -> Return override; + auto operator()(Params &&...args) noexcept -> Return override; - auto clone() const -> ICopyableFunctor<Return(Args...)> * override; + auto clone() const noexcept -> ICopyableFunctor<Return(Params...)> * override; - void clone(ICopyableFunctor<Return(Args...)> *functor) const override; + void clone(ICopyableFunctor<Return(Params...)> *functor) const noexcept override; void destroy() noexcept override; @@ -41,10 +44,8 @@ public: [[nodiscard]] auto target(const std::type_info &type_info) const noexcept -> const void * override; - [[nodiscard]] auto target_type() const noexcept -> const std::type_info & override; - private: - AllocFunctor<Function, Allocator, Return(Args...)> _functor; + AllocFunctor<Function, Allocator, Return(Params...)> _functor; }; } // namespace yacppdic::internal |