From 8f8f05ce017aa85395f25a233e419dd8e0cee497 Mon Sep 17 00:00:00 2001 From: Faumaray Date: Mon, 20 Oct 2025 01:25:57 +0300 Subject: [PATCH] enforce ctx in constructor Signed-off-by: Faumaray --- include/Mod/Mod.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/Mod/Mod.hpp b/include/Mod/Mod.hpp index a01f97c..a0635de 100644 --- a/include/Mod/Mod.hpp +++ b/include/Mod/Mod.hpp @@ -17,7 +17,14 @@ template class Mod : public Base { private: static std::unique_ptr _vl_factory(const Context& ctx) { - return std::make_unique(ctx); + if (std::is_constructible_v()) + { + return std::make_unique(ctx); + } + else + { + return std::make_unique(); + } } // Registration only stores a factory pointer — no early T usage.