diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-12-31 12:52:10 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-12-31 15:02:32 +0000 |
commit | 06e64d7ccf053dbb11547edf3ba986d096b50045 (patch) | |
tree | a5d3429e7c3af313b5fcd5d69b30e63c211fe61e /lib/stream_support.h | |
parent | Pass lots more information during GeoData::walk (diff) | |
download | ilt-06e64d7ccf053dbb11547edf3ba986d096b50045.tar.bz2 ilt-06e64d7ccf053dbb11547edf3ba986d096b50045.tar.xz ilt-06e64d7ccf053dbb11547edf3ba986d096b50045.zip |
Add ArcSegment
Extends Arc, with method for determining intersection point with line segment
Diffstat (limited to 'lib/stream_support.h')
-rw-r--r-- | lib/stream_support.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/stream_support.h b/lib/stream_support.h index f21622a..f5c5e37 100644 --- a/lib/stream_support.h +++ b/lib/stream_support.h @@ -4,6 +4,7 @@ #include <glm/glm.hpp> #include <iostream> #include <maths.h> +#include <optional> #include <source_location> #include <span> #include <sstream> @@ -82,6 +83,16 @@ namespace std { { return s << EnumTypeDetails<E>::typeName << "::" << EnumDetails<E>::to_string(e).value(); } + + template<typename T> + inline std::ostream & + operator<<(std::ostream & s, const std::optional<T> & v) + { + if (v) { + return s << *v; + } + return s << "nullopt"; + } } template<typename T> |