mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -167,7 +167,7 @@ inline To& refCast(From& r, const dictionary& d)
|
|||||||
|
|
||||||
//- Check if dynamic_cast to TargetType is possible
|
//- Check if dynamic_cast to TargetType is possible
|
||||||
template<class TargetType, class Type>
|
template<class TargetType, class Type>
|
||||||
inline bool isA(const Type& t)
|
inline const TargetType* isA(const Type& t)
|
||||||
{
|
{
|
||||||
const Type* p = &t;
|
const Type* p = &t;
|
||||||
return dynamic_cast<const TargetType*>(p);
|
return dynamic_cast<const TargetType*>(p);
|
||||||
|
|||||||
Reference in New Issue
Block a user