ENH: add const_cast variants for isA<> and refCast<>
- 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
Showing
- src/OpenFOAM/db/typeInfo/typeInfo.H 53 additions, 18 deletionssrc/OpenFOAM/db/typeInfo/typeInfo.H
- src/dynamicFaMesh/interfaceTrackingFvMesh/functionObjects/writeFreeSurface/writeFreeSurface.C 4 additions, 8 deletions...vMesh/functionObjects/writeFreeSurface/writeFreeSurface.C
- src/dynamicFaMesh/interfaceTrackingFvMesh/fvPatchFields/freeSurfacePressure/freeSurfacePressureFvPatchScalarField.C 7 additions, 7 deletions...eeSurfacePressure/freeSurfacePressureFvPatchScalarField.C
- src/meshTools/matrices/lduMatrix/preconditioners/distributedDILUPreconditioner/distributedDILUPreconditioner.C 7 additions, 7 deletions...ributedDILUPreconditioner/distributedDILUPreconditioner.C
- src/meshTools/matrices/lduMatrix/preconditioners/distributedDILUPreconditioner/processorColour.C 1 addition, 1 deletion...ditioners/distributedDILUPreconditioner/processorColour.C
- src/sampling/surface/cutting/cuttingPlaneCuts.C 12 additions, 19 deletionssrc/sampling/surface/cutting/cuttingPlaneCuts.C
Please register or sign in to comment