STYLE: return a pointer instead of bool for isA<>

- in some cases this means you could avoid an isA<> followed by
  second dynamicCast<>
This commit is contained in:
Mark Olesen
2018-12-20 18:02:16 +01:00
parent 1d85fecf4d
commit 17419209a7

View File

@ -167,7 +167,7 @@ inline To& refCast(From& r, const dictionary& d)
//- Check if dynamic_cast to TargetType is possible
template<class TargetType, class Type>
inline bool isA(const Type& t)
inline const TargetType* isA(const Type& t)
{
const Type* p = &t;
return dynamic_cast<const TargetType*>(p);