diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-04-04 20:06:36 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2024-04-04 20:06:36 +0100 |
commit | 30b027f84772d4b1d18eebd03b83ce3a5966d5fe (patch) | |
tree | bf1f424ee3c92516d652934cf502ee06f60c57e5 /lib/stream_support.h | |
parent | Simplify vector addition/subtraction with differnt types (diff) | |
parent | Remove wireframe mode from test renders (diff) | |
download | ilt-30b027f84772d4b1d18eebd03b83ce3a5966d5fe.tar.bz2 ilt-30b027f84772d4b1d18eebd03b83ce3a5966d5fe.tar.xz ilt-30b027f84772d4b1d18eebd03b83ce3a5966d5fe.zip |
Merge remote-tracking branch 'origin/deform-terrain'
Two related issues remain:
* Terrain self shadowing is common and handled poorly
* Odd, but mathematically correct patterns/stripes in feature boundaries
Neither of these relate directly to deformation.
Diffstat (limited to 'lib/stream_support.h')
-rw-r--r-- | lib/stream_support.h | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/stream_support.h b/lib/stream_support.h index fa536f1..57d82a1 100644 --- a/lib/stream_support.h +++ b/lib/stream_support.h @@ -11,17 +11,16 @@ template<typename S> concept stringlike = requires(const S & s) { s.substr(0); }; template<typename T> -concept spanable = std::is_constructible_v<std::span<const typename T::value_type>, T> && !stringlike<T> - && !std::is_same_v<std::span<typename T::value_type>, T>; +concept NonStringIterableCollection + = std::is_same_v<decltype(std::declval<T>().begin()), decltype(std::declval<T>().end())> && !stringlike<T>; namespace std { - template<typename T, std::size_t L> std::ostream & - operator<<(std::ostream & s, const span<T, L> v) + operator<<(std::ostream & s, const NonStringIterableCollection auto & v) { s << '('; for (const auto & i : v) { - if (&i != &v.front()) { + if (&i != &*v.begin()) { s << ", "; } s << i; @@ -43,13 +42,6 @@ namespace std { return (s << std::span {&v[0], L}); } - template<spanable T> - std::ostream & - operator<<(std::ostream & s, const T & v) - { - return (s << std::span {v}); - } - template<typename First, typename Second> std::ostream & operator<<(std::ostream & s, const std::pair<First, Second> & v) |