Commit 8b246531 authored by Victor Zverovich's avatar Victor Zverovich

Update changelog

parent 5ad54256
...@@ -41,11 +41,11 @@ ...@@ -41,11 +41,11 @@
.. code:: c++ .. code:: c++
struct S {}; struct Answer {};
namespace fmt { namespace fmt {
template <> template <>
struct formatter<S> { struct formatter<Answer> {
constexpr auto parse(parse_context& ctx) { constexpr auto parse(parse_context& ctx) {
auto it = ctx.begin(); auto it = ctx.begin();
spec = *it; spec = *it;
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
} }
template <typename FormatContext> template <typename FormatContext>
auto format(S, FormatContext& ctx) { auto format(Answer, FormatContext& ctx) {
return spec == 's' ? return spec == 's' ?
format_to(ctx.begin(), "{}", "fourty-two") : format_to(ctx.begin(), "{}", "fourty-two") :
format_to(ctx.begin(), "{}", 42); format_to(ctx.begin(), "{}", 42);
...@@ -65,10 +65,10 @@ ...@@ -65,10 +65,10 @@
}; };
} }
std::string s = format(fmt("{:x}"), S()); std::string s = format(fmt("{:x}"), Answer());
gives a compile-time error due to invalid format specifier (`godbolt gives a compile-time error due to invalid format specifier (`godbolt
<https://godbolt.org/g/ywhrPp>`_):: <https://godbolt.org/g/2jQ1Dv>`_)::
... ...
<source>:12:45: error: expression '<throw-expression>' is not a constant expression <source>:12:45: error: expression '<throw-expression>' is not a constant expression
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment