isle-portable icon indicating copy to clipboard operation
isle-portable copied to clipboard

Add template helper for `dynamic_cast`'s

Open foxtacles opened this issue 11 months ago • 1 comments

dynamic_cast's shouldn't fail. Where they do, we need to add logging (or better, an assert)

foxtacles avatar May 19 '25 16:05 foxtacles

It depends on the reason for the dynamic_cast: If the cast is to test if an object is a kind of class, they shouldn't be changed. if the cast is meant to turn the object explicitly into a specific class, perhaps static_cast would fit better?

MaddTheSane avatar May 27 '25 23:05 MaddTheSane

@foxtacles there are only 2 of these, is a template really needed?

AJenbo avatar Jul 05 '25 20:07 AJenbo

I would at least like an assert so that the dynamic casts don't quietly fail. If we only have 2 of these and won't have more than I guess we can save us the template.

foxtacles avatar Jul 05 '25 20:07 foxtacles