1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once


#include <algorithm><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <iterator><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <concepts><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <ranges><--- Include file:  not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include "internal/dev_env.hpp"

#include "adaptor/valarray.hpp"


namespace uni {


template<std::ranges::range R, class F>
inline R applied(R v, F&& func) noexcept(NO_EXCEPT) {
    func(std::ranges::begin(v), std::ranges::end(v));
    return v;
}

template<std::ranges::range R>
inline auto sorted(R&& v) noexcept(NO_EXCEPT) {
    return applied(std::forward<R>(v), std::ranges::sort);
}

template<std::ranges::range R>
inline auto reversed(R&& v) noexcept(NO_EXCEPT) {
    return applied(std::forward<R>(v), std::ranges::reverse);
}


} // namespace uni