/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWCore/Utilities/interface/transform.h
24 строки
877 B
Shahzad Malik Muzaffar
[CORE] [LLVM21] Apply code-checks and formats
10 фев 2026, 00:27
10 фев 2026, 00:27
65dfa67
Код
Авторство
О чём код?
#ifndef FWCore_Utilities_transform_h #define FWCore_Utilities_transform_h #include <vector> #include <type_traits> namespace edm { // helper template function to build a vector applying a transformation to the elements of an input vector template <typename InputType, typename Function> auto vector_transform(std::vector<InputType> const& input, Function predicate) -> std::vector< typename std::remove_cv<typename std::remove_reference<decltype(predicate(input.front()))>::type>::type> { using ReturnType = typename std::remove_cv<typename std::remove_reference<decltype(predicate(input.front()))>::type>::type; std::vector<ReturnType> output; output.reserve(input.size()); for (auto const& element : input) output.push_back(predicate(element)); return output; } } // namespace edm #endif // FWCore_Utilities_transform_h