20 #ifndef OPM_FUNCTIONAL_HPP 21 #define OPM_FUNCTIONAL_HPP 84 template <
typename F,
typename C>
85 auto map(F&& f, C&& c)
87 using Val = std::remove_cv_t<std::remove_reference_t<
88 decltype(std::invoke(std::forward<F>(f), *std::begin(std::forward<C>(c))))>>;
90 std::vector<Val> ret{};
91 ret.reserve(std::size(std::forward<C>(c)));
93 std::ranges::transform(c, std::back_inserter(ret), std::forward<F>(f));
106 template<
typename A >
107 std::vector< A > concat( std::vector< std::vector< A > >&& src ) {
108 const auto size = std::accumulate( src.begin(), src.end(), 0,
109 []( std::size_t acc,
const std::vector< A >& x ) {
110 return acc + x.size();
114 std::vector< A > dst;
118 std::move( x.begin(), x.end(), std::back_inserter( dst ) );
200 explicit iota(
int end );
201 iota(
int begin,
int end );
205 using difference_type = int;
206 using value_type = int;
207 using pointer =
int*;
208 using reference =
int&;
209 using iterator_category = std::forward_iterator_tag;
213 int operator*()
const;
228 std::size_t size()
const;
241 #endif //OPM_FUNCTIONAL_HPP Definition: Functional.hpp:203
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: Functional.hpp:198