File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 4848// /
4949// / // Create a TNamed on the python side, and transfer it back and forth.
5050// / root [1] std::any res1;
51- // / root [2] TPython::Exec("_anyresult = ROOT.std.make_any[' TNamed'] ('hello', '')", &res1);
51+ // / root [2] TPython::Exec("_anyresult = ROOT.std.any(ROOT. TNamed('hello', '') )", &res1);
5252// / root [3] TPython::Bind(&std::any_cast<TNamed&>(res1), "n");
5353// / root [4] std::any res2;
54- // / root [5] TPython::Exec("_anyresult = ROOT.std.make_any['TNamed*', 'TNamed*'] (n)", &res2);
55- // / root [6] (& std::any_cast<TNamed&>(res1) == std::any_cast<TNamed* >(res2))
54+ // / root [5] TPython::Exec("_anyresult = ROOT.std.any (n)", &res2);
55+ // / root [6] strcmp( std::any_cast<TNamed&>(res1).GetName(), std::any_cast<TNamed& >(res2).GetName()) == 0
5656// / (bool) true
5757// /
5858// / // Variables can cross-over by using an `std::any` with a specific name.
59- // / root [6] TPython::Exec("_anyresult = ROOT.std.make_any['Int_t'] (1 + 1)", &res1);
59+ // / root [6] TPython::Exec("_anyresult = ROOT.std.any (1 + 1)", &res1);
6060// / root [7] std::any_cast<int>(res1)
6161// / (int) 2
6262// / ~~~
Original file line number Diff line number Diff line change @@ -37,6 +37,6 @@ TEST(TPython, ExecMultithreading)
3737
3838 // In the end, let's check if the size is correct.
3939 std::any len;
40- TPython::Exec (" _anyresult = ROOT.std.make_any['int'] (len(arr))" , &len);
40+ TPython::Exec (" _anyresult = ROOT.std.any (len(arr))" , &len);
4141 EXPECT_EQ (std::any_cast<int >(len), nThreads);
4242}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def test_exec(self):
2121 {
2222 std::any out;
2323 std::stringstream cmd;
24- cmd << "_anyresult = ROOT.std.make_any['int'] (" << nIn << ")";
24+ cmd << "_anyresult = ROOT.std.any (" << nIn << ")";
2525 TPython::Exec(cmd.str().c_str(), &out);
2626 return std::any_cast<int>(out);
2727 }
You can’t perform that action at this time.
0 commit comments