From 17419209a70742aa3a226055b4561dde2e2d2f4c Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 20 Dec 2018 18:02:16 +0100 Subject: [PATCH] STYLE: return a pointer instead of bool for isA<> - in some cases this means you could avoid an isA<> followed by second dynamicCast<> --- src/OpenFOAM/db/typeInfo/typeInfo.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenFOAM/db/typeInfo/typeInfo.H b/src/OpenFOAM/db/typeInfo/typeInfo.H index 95d6c79c7f..0011f17d45 100644 --- a/src/OpenFOAM/db/typeInfo/typeInfo.H +++ b/src/OpenFOAM/db/typeInfo/typeInfo.H @@ -167,7 +167,7 @@ inline To& refCast(From& r, const dictionary& d) //- Check if dynamic_cast to TargetType is possible template -inline bool isA(const Type& t) +inline const TargetType* isA(const Type& t) { const Type* p = &t; return dynamic_cast(p);