diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-10 13:19:19 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-10 13:19:19 +0100 |
commit | 38fc122b84fce3a0e6299069524e80a73818d928 (patch) | |
tree | 45bcbfa30d0a8c2bb7fee2f18d3e1f42ea00240d | |
parent | One OpenMesh instance per top level Use in createMesh (diff) | |
download | ilt-38fc122b84fce3a0e6299069524e80a73818d928.tar.bz2 ilt-38fc122b84fce3a0e6299069524e80a73818d928.tar.xz ilt-38fc122b84fce3a0e6299069524e80a73818d928.zip |
Constraint operator* collection helper to IterableCollections
-rw-r--r-- | lib/collections.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/collections.hpp b/lib/collections.hpp index 59cec6f..4df622e 100644 --- a/lib/collections.hpp +++ b/lib/collections.hpp @@ -65,10 +65,11 @@ operator*=(IterableCollection auto & in, auto && f) } template<template<typename...> typename C, typename... T> + requires IterableCollection<C<T...>> [[nodiscard]] constexpr auto operator*(const C<T...> & in, auto && f) { - C<decltype(f(in[0]))> out; + C<decltype(f(*in.begin()))> out; std::transform(in.begin(), in.end(), std::inserter(out, out.end()), f); return out; |