#pragma once #include "factory.hpp" template Factory::Factory(const Factory &factory) : _functor(factory._functor) { } template Factory::Factory(Factory &&factory) noexcept : _functor(std::move(factory._functor)) { } template auto Factory::operator=(Factory &&factory) noexcept -> Factory & { _functor = std::move(factory._functor); return *this; } template auto Factory::operator=(std::nullptr_t) noexcept -> Factory & { _functor = nullptr; return *this; } template Factory::~Factory() = default; template Factory::operator bool() const noexcept { return static_cast(_functor); } template auto Factory::operator()(Args... args) const -> Return { return _functor(std::forward(args)...); } template auto Factory::target_type() const noexcept -> const std::type_info & { return _functor.target_type(); } template template auto Factory::target() noexcept -> Tp * { return static_cast(_functor.template target()); } template template auto Factory::target() const noexcept -> const Tp * { return _functor.template target(); }