Commit 941f3e9
committed
[RF] Fix wrong usage of
After getting confused for some time why some fits don't work with the
new CPU backend, I found one of the problems: the `std::ostringstream`
was used incorrectly since 916a180 (commit from 10 years ago).
The `std::ostringstream` constructor arguments do not initialize the
stream with that string — the argument sets the open mode, not the
contents.
This can be seen with this little example in the interpreter.
```txt
root [0] const char *pfx = "hello";
root [1] std::ostringstream os(pfx);
root [2] os << " world";
root [3] os.str()
(std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::__string_type) " world"
root [4] .q
```
The result is that the prefix doesn't get added, and hence it can happen
that many nodes in the computation graph can have the same name,
breaking the assumptions of the new RooFit evaluation backend.std::ostringstream in RooProdPdf1 parent da1ebd9 commit 941f3e9
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1438 | 1438 | | |
1439 | 1439 | | |
1440 | 1440 | | |
1441 | | - | |
| 1441 | + | |
| 1442 | + | |
1442 | 1443 | | |
1443 | 1444 | | |
1444 | 1445 | | |
| |||
0 commit comments