diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-29 19:29:08 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:58 +0200 |
commit | 40c828455d094854d9e531fc7dd0d1a0244957b7 (patch) | |
tree | 5e9e7e5156f0907d58791b6e7e7f3adff44bb4b3 /src/bootstrap.cpp | |
parent | a8fbce594f87554b48da661c7939559be801da13 (diff) |
refactor: make container use concepts
Diffstat (limited to 'src/bootstrap.cpp')
-rw-r--r-- | src/bootstrap.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/bootstrap.cpp b/src/bootstrap.cpp index 1436301..f22c689 100644 --- a/src/bootstrap.cpp +++ b/src/bootstrap.cpp @@ -31,6 +31,7 @@ #include "randomization/generator.hpp" #include "randomization/seed_generator.hpp" +#include "DI/concepts.hpp" #include "util/function.hpp" #include <concepts> @@ -38,11 +39,8 @@ #include <random> #include <string_view> -template <typename Type> -concept abstract = std::is_abstract_v<Type>; - template <typename Interface, typename Impl, typename... Params> -requires abstract<Interface> && std::derived_from<Impl, Interface> && +requires Abstract<Interface> && std::derived_from<Impl, Interface> && std::constructible_from<Impl, Params...> auto construct_as_interface(Params &&...parameters) -> std::shared_ptr<Interface> { |