In my application i have double (or float) variables that might be "empty", as in holding no valid value. How can i represent this condition with the built in types float and double?
One option would be a wrapper that has a float ad a boolean, but that can´t work, as my libraries have containers that store doubles and not objects that behave as doubles. Another would be using NaN (std::numeric_limits). But i see no way to check for a variable being NaN.
How would yourself solve the problem of needing a "special" float value to mean something other then the number?
Thanks!