search for: format_time_point

Displaying 2 results from an estimated 2 matches for "format_time_point".

2016 Oct 12
2
RFC: General purpose type-safe formatting library
...your std::chrono::time_point, but there's no way to integrate it into llvm::format. So with my proposed library you could write: os << format_string("Start: {0}, End: {1}, Elapsed: {2:ms}", start, end, start-end); Or you could write: os << "Start: " << format_time_point(start) << ", End: " << format_time_point(end) << ", Elapsed: " << std::chrono::duration_cast<std::chrono::millis>(start-end).count(); -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail...
2016 Oct 12
15
RFC: General purpose type-safe formatting library
A while back llvm::format() was introduced that made it possible to combine printf-style formatting with llvm streams. However, this still comes with all the risks and pitfalls of printf. Everyone is no-doubt familiar with these problems, but here are just a few anyway: 1. *Not type-safe.* Not all compilers warn when you mess up the format specifier. And when you're writing your own