Skip to content

Commit b2fd3be

Browse files
committed
Minor update to <print> example
1 parent a4e43c8 commit b2fd3be

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

doc/modules/ROOT/pages/examples.adoc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ pass:[{fmt}] support is available starting with pass:[C++14] so long as you have
158158
[#examples_fmt_format]
159159
=== `<fmt/format.hpp>`
160160

161-
We also provide support for pass:[{fmt}] so you can easily just swap the namespaces and headers on the above example:
161+
This example can be found in the `examples/` folder as https://github.com/cppalliance/decimal/blob/develop/examples/fmt_format.cpp[fmt_format.cpp].
162162

163163
[source, c++]
164164
----
@@ -223,6 +223,9 @@ Scientific Format with Specified Precision and Padding:
223223
03.141e+00
224224
----
225225

226+
IMPORTANT: If you are using the convenience header `<boost/decimal.hpp>` the header `<boost/decimal/fmt_format.hpp>` is *NOT* automatically included since it requires an external library.
227+
You must include it yourself.
228+
226229
[#examples_std_format]
227230
=== `<format>`
228231

@@ -257,7 +260,8 @@ Scientific Format with Specified Precision and Padding:
257260
[#examples_print]
258261
== `<print>`
259262

260-
We can make one final change to our `<format>` example where instead of using `std::cout`, we use pass:[C++23's] `<print>`:
263+
We can make one final change to our `<format>` example where instead of using `std::cout`, we use pass:[C++23's] `<print>`.
264+
This example can be found in the `examples/` folder as https://github.com/cppalliance/decimal/blob/develop/examples/print.cpp[print.cpp].
261265

262266
[source, c++]
263267
----
@@ -275,3 +279,9 @@ int main()
275279
return 0;
276280
}
277281
----
282+
283+
Expected Output:
284+
----
285+
03.140e+00
286+
03.141e+00
287+
----

examples/print.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
#if defined(BOOST_DECIMAL_HAS_FORMAT_SUPPORT) && defined(BOOST_DECIMAL_HAS_PRINT_SUPPORT)
1818

19-
#include <print>
20-
2119
int main()
2220
{
2321
constexpr boost::decimal::decimal64_t val1 {314, -2};

0 commit comments

Comments
 (0)