enforce ctx in constructor
Signed-off-by: Faumaray <faumaray@gmail.com>
This commit is contained in:
1 file changed
+11
-12
+11
-12
@@ -5,19 +5,9 @@
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
#include <typeinfo>
|
||||
|
||||
namespace vl::mod {
|
||||
|
||||
#if defined(__ELF__)
|
||||
#define VL_MOD_SECTION __attribute__((section("vlmods"), used))
|
||||
#else
|
||||
#define VL_MOD_SECTION __attribute__((used))
|
||||
#endif
|
||||
|
||||
// ---- Contract Concepts ----
|
||||
template<class T>
|
||||
concept HasCtorWithContext =
|
||||
requires(const Context& ctx) {
|
||||
requires(const vl::mod::Context& ctx) {
|
||||
{ T(ctx) };
|
||||
};
|
||||
|
||||
@@ -38,7 +28,16 @@ concept HasLifecycle =
|
||||
requires(T obj) {
|
||||
{ obj.onStart() } -> std::same_as<void>;
|
||||
{ obj.onStop() } -> std::same_as<void>;
|
||||
};
|
||||
};namespace vl::mod {
|
||||
|
||||
#if defined(__ELF__)
|
||||
#define VL_MOD_SECTION __attribute__((section("vlmods"), used))
|
||||
#else
|
||||
#define VL_MOD_SECTION __attribute__((used))
|
||||
#endif
|
||||
|
||||
// ---- Contract Concepts ----
|
||||
|
||||
|
||||
template <
|
||||
class T
|
||||
|
||||
Reference in new issue
Block a user