diff --git a/doc/hash2/examples.adoc b/doc/hash2/examples.adoc index 686d481..9ed1e5e 100644 --- a/doc/hash2/examples.adoc +++ b/doc/hash2/examples.adoc @@ -73,7 +73,7 @@ This example demonstrates calculating the MD5 digest of a data array, embedded i [source] ---- -include::../../example/compile_time.cpp[lines=5..-1] +include::../../example/compile_time.cpp[lines=11..-1] ---- Since the `constexpr` overload of `update` takes `unsigned char const*` (`void const*` is not allowed in `constexpr` functions), if the @@ -82,6 +82,6 @@ use `hash_append_range` instead of calling `update`, as in the following example [source] ---- -include::../../example/compile_time_2.cpp[lines=5..-1] +include::../../example/compile_time_2.cpp[lines=11..-1] ---- diff --git a/example/compile_time.cpp b/example/compile_time.cpp index cd4db31..349368c 100644 --- a/example/compile_time.cpp +++ b/example/compile_time.cpp @@ -2,6 +2,12 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include + +#if defined(BOOST_MSVC) && BOOST_MSVC < 1920 +# pragma warning(disable: 4307) // integral constant overflow +#endif + #include #include diff --git a/example/compile_time_2.cpp b/example/compile_time_2.cpp index be4d842..a290d1d 100644 --- a/example/compile_time_2.cpp +++ b/example/compile_time_2.cpp @@ -2,6 +2,12 @@ // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt +#include + +#if defined(BOOST_MSVC) && BOOST_MSVC < 1920 +# pragma warning(disable: 4307) // integral constant overflow +#endif + #include #include #include