Consider this example of type inference:
auto var = 1.0 ;
Does this evaluate to a float or double under C++11 type inference?, can this behaviour be controlled?
Consider this example of type inference:
auto var = 1.0 ;
Does this evaluate to a float or double under C++11 type inference?, can this behaviour be controlled?
It will be evaluated as a double
and yes, you can control it.
In the standard ISO-14882:2011, 2.14.4 Floating literals, point 1:
The type of a floating literal is double unless explicitly specified by a suffix. The suffixes f and F specify float, the suffixes l and L specify long double. If the scaled value is not in the range of representable values for its type, the program is ill-formed.