Skip to content

PR - removing reliance on RTTI - #73

Open
lpastrana-phaseview wants to merge 1 commit into
Fattorino:masterfrom
lpastrana-phaseview:fix-reliance-on-RTTI
Open

PR - removing reliance on RTTI#73
lpastrana-phaseview wants to merge 1 commit into
Fattorino:masterfrom
lpastrana-phaseview:fix-reliance-on-RTTI

Conversation

@lpastrana-phaseview

Copy link
Copy Markdown

Hello,

I'm working on a project where RTTI is not available and hit a stopper in ImNodeFlow in that regard.

In environments where RTTI is disabled (e.g. -fno-rtti / /GR-), typeid() is unavailable, making ConnectionFilter and getDataType() unusable.

This patch replaces the typeid-based type comparison with template-based equivalents using <type_traits>, which work without RTTI:

SameType() now uses std::is_same_v on the deduced types of connected pins
Numbers() now uses std::is_arithmetic_v on the output pin's value type
None() simplified to generic lambdas — no type info needed
getDataType() overrides commented out as the filters above no longer depend on them and they have no no-RTTI equivalent;
No behavioral change in RTTI-enabled builds for the None and Numbers filters.
SameType now performs a stricter compile-time check rather than a runtime type_info comparison.

Regards,

Lorenzo

PS: I've simply commented out getDataType() so far, let me know if you want it removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant