Comment Comment by rnallandigal The std::to_chars function returns an object of type std::to_chars_result, which defines an operator bool() checking if ec == std::errc[0].The if statement determines which branch to take based on the value of the condition. This value is contextually converted to a bool and evaluated[1].[0] https://en.cppreference.com/w/cpp/utility/to_chars_result[1] https://en.cppreference.com/w/cpp/language/if#Condition parent rnallandigal 2 years ago
The if statement determines which branch to take based on the value of the condition. This value is contextually converted to a bool and evaluated[1].
[0] https://en.cppreference.com/w/cpp/utility/to_chars_result
[1] https://en.cppreference.com/w/cpp/language/if#Condition