You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some good news is that we now have the convenient std::to_string(). We should be able to replace CDeviceUtils::ConvertToString(x) with std::to_string(x).c_str() in most cases. However,
The formatting will not match in the case of double x
Special case is needed for bool x if maintaining exact behavior
We should ensure that there are no performance issues when used in the critical path of camera frame metadata generation (probably okay because formatted numbers usually fit in std::string's small-buffer optimization, meaning no allocation happens -- but something to be aware of)
In any case the solution is not quite trivial, and I don't want to add a deprecation warning for this (too many uses), so recording this issue for now.
The text was updated successfully, but these errors were encountered:
It uses a common static buffer, so it is (1) not thread-safe and (2) error-prone even when used in only one thread.
For example, what this code will print is up to the whim of the compiler:
mmCoreAndDevices/DeviceAdapters/Modbus/ModbusModule.cpp
Line 185 in 1aa373b
Some good news is that we now have the convenient
std::to_string()
. We should be able to replaceCDeviceUtils::ConvertToString(x)
withstd::to_string(x).c_str()
in most cases. However,double x
bool x
if maintaining exact behaviorstd::string
's small-buffer optimization, meaning no allocation happens -- but something to be aware of)In any case the solution is not quite trivial, and I don't want to add a deprecation warning for this (too many uses), so recording this issue for now.
The text was updated successfully, but these errors were encountered: