#pragma once #include "DI/interfaces/wrapper.hpp" #include "DI/object_type.hpp" #include "DI/type_traits.hpp" #include #include #include class Container; template class BindingBuilder { public: explicit BindingBuilder(Container *container) noexcept; template >> void to() noexcept; void to_factory(Interface func) noexcept; private: Container *_container; }; class Container { public: Container() noexcept = default; template auto bind() noexcept -> BindingBuilder; template >> auto get() const noexcept -> std::shared_ptr; template >> auto get() const noexcept -> Interface; std::unordered_map, ObjectTypeHasher> bindings; }; #include "container.tpp"