#pragma once #include /** * A copyable function object. */ template class ICopyableFunctor; template class ICopyableFunctor { public: ICopyableFunctor() = default; ICopyableFunctor(const ICopyableFunctor &) = delete; ICopyableFunctor(ICopyableFunctor &&) = delete; virtual ~ICopyableFunctor() = default; [[nodiscard]] virtual auto clone() const -> ICopyableFunctor * = 0; virtual void clone(ICopyableFunctor *) const = 0; virtual void destroy() noexcept = 0; virtual void destroy_deallocate() noexcept = 0; virtual auto operator()(Args &&...) -> Return = 0; auto operator=(const ICopyableFunctor &) = delete; auto operator=(ICopyableFunctor &&) = delete; [[nodiscard]] virtual auto target(const std::type_info &) const noexcept -> const void * = 0; [[nodiscard]] virtual auto target_type() const noexcept -> const std::type_info & = 0; };