Using 'auto' type deduction - how to find out what type the compiler deduced?
问题 How can I find out what type the compiler deduced when using the auto keyword? Example 1: Simpler auto tickTime = 0.001; Was this deduced as a float or a double? Example 2: More complex (and my present headache): typedef std::ratio<1, 1> sec; std::chrono::duration<double, sec > timePerTick2{0.001}; auto nextTickTime = std::chrono::high_resolution_clock::now() + timePerTick2; What type is nextTickTime ? The problem I'm having is when I try to send nextTickTime to std::cout . I get the