X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8ffb62089250c85576933a6eb1bb3be501712840..4634214e18b847f6346048fa12179d3d99ae82c9:/include/xbt/dynar.h diff --git a/include/xbt/dynar.h b/include/xbt/dynar.h index 52a99e05b9..095187f380 100644 --- a/include/xbt/dynar.h +++ b/include/xbt/dynar.h @@ -260,4 +260,16 @@ xbt_dynar_foreach (dyn,cpt,str) { /** @} */ SG_END_DECL() +#ifdef __cplusplus +namespace simgrid { +namespace xbt { +/** Dynar of `T*` which `delete` its values */ +template inline xbt_dynar_t newDeleteDynar() +{ + return xbt_dynar_new(sizeof(T*), [](void* p) { delete *(T**)p; }); +} +} +} +#endif + #endif /* XBT_DYNAR_H */