mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
- an example of the new, more succinct refConstCast version:
auto& abc = refConstCast<adjointVectorBoundaryCondition>(Uab);
older:
adjointVectorBoundaryCondition& abc =
refCast<adjointVectorBoundaryCondition>
(
const_cast<fvPatchVectorField&>(Uab)
);
or:
adjointVectorBoundaryCondition& abc =
const_cast<adjointVectorBoundaryCondition&>
(
refCast<const adjointVectorBoundaryCondition>(Uab)
);
- an example of the new, more succinct isA_constCast version:
auto* acapPtr = isA_constCast<fieldType>(abf[patchi]);
if (acapPtr)
{
auto& acap = *acapPtr;
...
}
older:
if (isA<fieldType>(abf[patchi]))
{
fieldType& acap =
const_cast<fieldType&>
(
refCast<const fieldType>(abf[patchi])
);
...
}
STYLE: remove spurious 'const' qualifier from isA<> use