use dynamic cast instead of c-style cast when casting from base type to derived class
This commit is contained in:
@ -35,7 +35,7 @@ void BondDeprecated::settings(int, char **)
|
||||
// called, our style was just added at the end of the list of substyles
|
||||
|
||||
if (utils::strmatch(my_style,"^hybrid")) {
|
||||
BondHybrid *hybrid = (BondHybrid *)force->bond;
|
||||
auto hybrid = dynamic_cast<BondHybrid *>(force->bond);
|
||||
my_style = hybrid->keywords[hybrid->nstyles];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user