A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use a std::vector<std::string> for process arguments.
[simgrid.git]
/
include
/
xbt
/
dynar.hpp
diff --git
a/include/xbt/dynar.hpp
b/include/xbt/dynar.hpp
index
7ef2e68
..
d9f77b5
100644
(file)
--- a/
include/xbt/dynar.hpp
+++ b/
include/xbt/dynar.hpp
@@
-1,14
+1,13
@@
-/* Copyright (c) 2004-2007, 2009-201
5
. The SimGrid Team.
+/* Copyright (c) 2004-2007, 2009-201
7
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#ifndef SIMGRI
d
_XBT_DYNAR_HPP
-#define SIMGRI
d
_XBT_DYNAR_HPP
+#ifndef SIMGRI
D
_XBT_DYNAR_HPP
+#define SIMGRI
D
_XBT_DYNAR_HPP
#include <boost/range/iterator_range.hpp>
#include <boost/range/iterator_range.hpp>
-
#include <xbt/asserts.h>
#include <xbt/dynar.h>
#include <xbt/asserts.h>
#include <xbt/dynar.h>
@@
-33,7
+32,14
@@
DynarRange<T> range(xbt_dynar_t dynar)
(T*) ((char*) dynar->data + dynar->used * dynar->elmsize));
}
(T*) ((char*) dynar->data + dynar->used * dynar->elmsize));
}
-}
+/** Dynar of `T*` which `delete` its values */
+template<class T> inline
+xbt_dynar_t newDeleteDynar()
+{
+ return xbt_dynar_new(sizeof(T*),
+ [](void* p) { delete *(T**)p; });
}
}
+}
+}
#endif
#endif