diff --git a/src/typed-geometry/detail/optional.hh b/src/typed-geometry/detail/optional.hh index f7f3fd7e7a411aa690be267399eb2d8a19978df3..dba24b1e5b21e302ec51a591b40e0e30a573f541 100644 --- a/src/typed-geometry/detail/optional.hh +++ b/src/typed-geometry/detail/optional.hh @@ -45,7 +45,7 @@ public: }; template -auto operator<<(Stream& os, optional const& o) -> decltype(os << o.value(), os << "", os) +auto operator<<(Stream& os, optional const& o) -> decltype(os << o.value(), os << std::declval(), os) { return o.has_value() ? (os << o.value()) : (os << "[empty]"); } diff --git a/src/typed-geometry/detail/utility.hh b/src/typed-geometry/detail/utility.hh index 4e5012daf15352c187710c00ddb4587a0000324c..d084e15053b990e8cb07e0e44a2e321e49ecb500 100644 --- a/src/typed-geometry/detail/utility.hh +++ b/src/typed-geometry/detail/utility.hh @@ -35,7 +35,19 @@ template <> struct priority_tag<0> { }; + +// see https://stackoverflow.com/questions/44395169/why-is-sfinae-on-if-constexpr-not-allowed +template