Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14x-comb2023] Support ROOT 6.30 and C++20 #892

Merged

Conversation

guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Dec 21, 2023

Exact port of #873.

This helps do debug some things in the Higgs combination.

The destructor and assignment operators are not allowed to include
template specializations in C++20.

They were not needed anyway, because the class itself is templated.

Also, generalize the assignment operators to take `TH1` and check for
the dimension at runtime. This is necessary to avoid other compiler
warnings, such as:

```
interface/FastTemplate.h:123:34: warning: ‘FastTemplate_t<T>& FastTemplate_t<T>::operator=(const TH1&) [with T = double]’ was hidden [-Woverloaded-virtual=]
  123 |         virtual FastTemplate_t & operator=(const TH1 &other) {
      |                                  ^~~~~~~~
interface/FastTemplate.h:284:24: note:   by ‘FastHisto2D_t<double>::operator=’
  284 |         FastHisto2D_t& operator=(const TH2 &other) {
```

That is a very valid warning! `FastHisto2D_t` inherits from
`FastTemplate_t`, and it's not good if their assignment operators take
different types.
This will not work anymore in ROOT 6.30. The `double` value needs to be
retrieved from the proxy first.
@guitargeek
Copy link
Contributor Author

The CI failures are not related to this PR.

@jonathon-langford jonathon-langford merged commit f063bbf into cms-analysis:14x-comb2023 Apr 11, 2024
0 of 5 checks passed
@guitargeek guitargeek deleted the 14x-comb2023_fixes branch July 9, 2024 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants