diff --git a/src/objmem.h b/src/objmem.h index f452e068925..614c8a3a646 100644 --- a/src/objmem.h +++ b/src/objmem.h @@ -29,6 +29,7 @@ #include #include #include +#include /* The lists of objects allocated */ template @@ -166,6 +167,9 @@ enum class IterationResult template void mutating_list_iterate(std::list& list, MaybeErasingLoopBodyHandler handler) { + static_assert(std::is_same, IterationResult>::value, + "Loop body handler should return IterationResult"); + typename std::remove_reference_t::iterator it = list.begin(), itNext; while (it != list.end()) {