enforce ctx in constructor
Signed-off-by: Faumaray <faumaray@gmail.com>
This commit is contained in:
1 file changed
+2
-1
+2
-1
@@ -16,9 +16,10 @@ namespace vl::mod {
|
|||||||
// --- Contract concepts (NV2 + C2 + lifecycle) ---
|
// --- Contract concepts (NV2 + C2 + lifecycle) ---
|
||||||
|
|
||||||
// Must have T(const Context&)
|
// Must have T(const Context&)
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
concept HasCtorWithContext =
|
concept HasCtorWithContext =
|
||||||
requires(const Context& ctx) { { T{ctx} }; };
|
std::constructible_from<T, const Context&>;
|
||||||
|
|
||||||
// Must provide compile-time identity (SV1)
|
// Must provide compile-time identity (SV1)
|
||||||
template<class T>
|
template<class T>
|
||||||
|
|||||||
Reference in new issue
Block a user