#include "common/boxed_type.h" #include "common/empty.h" #include #include CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) { constexpr auto count = 3; switch(operation) { case CR_STEP: { // forces things to break auto ®istry = *static_cast(ctx->userdata); // forces the creation of the pool for the empty type static_cast(registry.storage()); const auto view = registry.view(); registry.insert(view.begin(), view.end(), test::empty{}); registry.view().each([cnt = count](test::boxed_int &elem) { elem.value += cnt; }); } break; case CR_CLOSE: case CR_LOAD: case CR_UNLOAD: // nothing to do here, this is only a test. break; } return 0; }