From b9c218334e39a4af5ace68ad3d22b5ed4219b8ee Mon Sep 17 00:00:00 2001 From: Thomas Lin Pedersen Date: Wed, 23 Oct 2024 09:51:00 +0200 Subject: [PATCH] Fix #147 --- src/SvgStream.cpp | 9 +++++++++ src/SvgStream.h | 7 ------- 2 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 src/SvgStream.cpp diff --git a/src/SvgStream.cpp b/src/SvgStream.cpp new file mode 100644 index 0000000..52590e6 --- /dev/null +++ b/src/SvgStream.cpp @@ -0,0 +1,9 @@ +#include "SvgStream.h" + +template <> +SvgStream& operator<<(SvgStream& object, const double& data) { + // Make sure negative zeros are converted to positive zero for + // reproducibility of SVGs + object.write(dbl_format(data)); + return object; +} diff --git a/src/SvgStream.h b/src/SvgStream.h index c178305..56ff569 100644 --- a/src/SvgStream.h +++ b/src/SvgStream.h @@ -65,13 +65,6 @@ SvgStream& operator<<(SvgStream& object, const T& data) { object.write(data); return object; } -template <> -SvgStream& operator<<(SvgStream& object, const double& data) { - // Make sure negative zeros are converted to positive zero for - // reproducibility of SVGs - object.write(dbl_format(data)); - return object; -} class SvgStreamFile : public SvgStream { std::ofstream stream_;