From 7ce503e6a02cfe1e07af146474af6ee7572e61ae Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 7 May 2016 08:50:51 -0700 Subject: [PATCH] Update changelog --- ChangeLog.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ChangeLog.rst b/ChangeLog.rst index 481f5d4c..ab3d2796 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -25,6 +25,26 @@ // Prints "The date is 2016-04-29." (with the current date) fmt::print("The date is {:%Y-%m-%d}.", *std::localtime(&t)); +* ``std::ostream`` support including formatting of user-defined types that provide + overloaded ``operator<<`` has been moved to ``fmt/ostream.h``: + + .. code:: c++ + + #include "fmt/ostream.h" + + class Date { + int year_, month_, day_; + public: + Date(int year, int month, int day) : year_(year), month_(month), day_(day) {} + + friend std::ostream &operator<<(std::ostream &os, const Date &d) { + return os << d.year_ << '-' << d.month_ << '-' << d.day_; + } + }; + + std::string s = fmt::format("The date is {}", Date(2012, 12, 9)); + // s == "The date is 2012-12-9" + * Added support for `custom argument formatters `_ (`#235 `_).