pocoproject / poco

The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.
https://pocoproject.org
Other
8.33k stars 2.15k forks source link

`Dynamic::Var` silently loses precision on int->float conversion #4423

Open aleks-f opened 8 months ago

aleks-f commented 8 months ago

Description As stated - on integral to floating point conversion, loss of precision is suppressed and ignored.

To Reproduce Assign an int value occupying more than 23 bits (on most platforms) to a float.

Expected behavior Precision loss should be allowed (as is in the language type system). However, it should be possible to enforce strict no-precision-loss policy for integral to floating point conversions.

andrewauclair commented 8 months ago

Should Poco consider migrating to std::any now that C++17 is supported?

aleks-f commented 8 months ago

Should Poco consider migrating to std::any now that C++17 is supported?

Poco::Any and std::any originate from the same source - Kevlin Henney's boost::any. I have no cycles to replace it, and I'm not sure it is worth the effort, either.