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
attempt to get rid of all const_cast (take 2)
[simgrid.git]
/
include
/
xbt
/
functional.hpp
diff --git
a/include/xbt/functional.hpp
b/include/xbt/functional.hpp
index
7596ef6
..
10c16bf
100644
(file)
--- a/
include/xbt/functional.hpp
+++ b/
include/xbt/functional.hpp
@@
-39,11
+39,12
@@
public:
{}
void operator()() const
{
+ char noarg[] = {'\0'};
const int argc = args_->size();
std::vector<std::string> args = *args_;
std::unique_ptr<char*[]> argv(new char*[argc + 1]);
for (int i = 0; i != argc; ++i)
- argv[i] = args[i].empty() ?
const_cast<char*>("")
: &args[i].front();
+ argv[i] = args[i].empty() ?
noarg
: &args[i].front();
argv[argc] = nullptr;
code_(argc, argv.get());
}