Closed trueqbit closed 5 years ago
Repeating my comment I originally placed on the PR:
I was following gcc's approach here, but I know that especially Visual C++ didn't implement those back in the days.
What if we 'macro'nize the standard test macros? I see two approaches here:
Hi trueqbit,
I'm very sorry for the late reply. I'm in such a hurry this month. Apologizes.
I think two separate macros would be better, thus even other fields that dislike these features (e.g. games) can disable them independently.
I'm all in for merging the PR given that it passes the unit test (may need some adaptation when these flags are active?).
Thank you for the interest. Wish you the best.
No worries, I am just trying to collaborate in one spot rather than forking and buggering off :)
From the environment I am currently coming from (Particle workbench), I actually would like to opt-out by default rather than manually. This is because Particle doesn't allow to pass any additional CPP macros to the compilation step. This decision means that on compilers without the standard macros people would have to explicitly opt-in.
Can you take another review to PR #11, please? I also added unit tests to ensure the decayed type is actually both stored and retrieved, plus a unit test asserting access violations, which are expected in place of throwing bad_any_cast.
Closed as seems to be resolved by #11
Compilation for embedded platforms is typically missing exception handling and RTTI. It would be nice to check the availability of those features like gcc does.
Furthermore, a different implementation of
any_cast
would solve the performance cost incurred by type_id comparisons.See pull request #8