use friend statement instead of (incorrect) cast to give access to protected class member

This commit is contained in:
Axel Kohlmeyer
2021-08-02 21:34:30 -04:00
parent 53050a0429
commit 04c7e7543e
3 changed files with 3 additions and 3 deletions

View File

@ -569,7 +569,7 @@ void PairHybrid::init_style()
// same style must not be used multiple times
for (istyle = 0; istyle < nstyles; istyle++) {
bool is_gpu = (((PairHybrid *)styles[istyle])->suffix_flag & Suffix::GPU);
bool is_gpu = styles[istyle]->suffix_flag & Suffix::GPU;
if (multiple[istyle] && is_gpu)
error->all(FLERR,"GPU package styles must not be used multiple times");
}