Skip to content

Commit

Permalink
fix: no copy constructor in PodioExample.cc
Browse files Browse the repository at this point in the history
Due to AIDASoft/podio#564 we get compilation errors:
```
  >> 322    /home/wdconinc/git/JANA2/src/examples/PodioExample/PodioExample.cc:46:51: error: call of overloaded 'ExampleHit(<brace-enclosed initializer list>)' is ambiguous
     323       46 |     hits2.push_back(ExampleHit({42, 5, -5, 5, 7.6}));
     324          |                                                   ^
     325    In file included from /home/wdconinc/git/JANA2/src/examples/PodioExample/datamodel/MutableExampleHit.h:8,
     326                     from /home/wdconinc/git/JANA2/src/examples/PodioExample/PodioExample.cc:7:
     327    /home/wdconinc/git/JANA2/src/examples/PodioExample/./datamodel/ExampleHit.h:59:3: note: candidate: 'ExampleHit::ExampleHit(const MutableExampleHit&)'
     328       59 |   ExampleHit(const MutableExampleHit& other);
     329          |   ^~~~~~~~~~
     330    /home/wdconinc/git/JANA2/src/examples/PodioExample/./datamodel/ExampleHit.h:47:3: note: candidate: 'ExampleHit::ExampleHit(const ExampleHit&)'
     331       47 |   ExampleHit(const ExampleHit& other) = default;
     332          |   ^~~~~~~~~~
```
This commit remove the ambiguity that is present by passing an initializer list to a constructor.

After this commit, JANA2 compiles both before and after podio PR 564 (and also with v00-17-03 which is before AIDASoft/podio#514 which led to JeffersonLab#269). There is no minimum podio version specified in CMakeLists.txt to test with.
  • Loading branch information
wdconinc authored Feb 23, 2024
1 parent d8fe7ad commit b33b79a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/examples/PodioExample/PodioExample.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ void create_hits_file() {
eventinfos1.push_back(eventinfo1);

ExampleHitCollection hits1;
hits1.push_back(ExampleHit({22, -1, -1, 0, 100}));
hits1.push_back(ExampleHit({49, 1, 1, 0, 15.5}));
hits1.push_back(ExampleHit({47, 1, 2, 0, 0.5}));
hits1.push_back(ExampleHit({42, 2, 1, 0, 4.0}));
hits1.push_back(ExampleHit(22, -1, -1, 0, 100));
hits1.push_back(ExampleHit(49, 1, 1, 0, 15.5));
hits1.push_back(ExampleHit(47, 1, 2, 0, 0.5));
hits1.push_back(ExampleHit(42, 2, 1, 0, 4.0));

podio::Frame event1;
event1.put(std::move(hits1), "hits");
Expand All @@ -43,10 +43,10 @@ void create_hits_file() {
eventinfos2.push_back(eventinfo2);

ExampleHitCollection hits2;
hits2.push_back(ExampleHit({42, 5, -5, 5, 7.6}));
hits2.push_back(ExampleHit({618, -3, -5, 1, 99.9}));
hits2.push_back(ExampleHit({27, -10, 10, 10, 22.2}));
hits2.push_back(ExampleHit({28, -9, 11, 10, 7.8}));
hits2.push_back(ExampleHit(42, 5, -5, 5, 7.6));
hits2.push_back(ExampleHit(618, -3, -5, 1, 99.9));
hits2.push_back(ExampleHit(27, -10, 10, 10, 22.2));
hits2.push_back(ExampleHit(28, -9, 11, 10, 7.8));

podio::Frame event2;
event2.put(std::move(hits2), "hits");
Expand Down

0 comments on commit b33b79a

Please sign in to comment.