Added namespace prefixes
This commit is contained in:
parent
e44b5c79c3
commit
e125cbe4fe
@ -21,14 +21,14 @@ namespace sc {
|
|||||||
template<class T, class M>
|
template<class T, class M>
|
||||||
std::vector<M> map(const std::vector<T>& seq, std::function<M(T)> fun) {
|
std::vector<M> map(const std::vector<T>& seq, std::function<M(T)> fun) {
|
||||||
std::vector<M> result;
|
std::vector<M> result;
|
||||||
std::transform(seq.begin(), seq.end(), back_inserter(result), fun);
|
std::transform(seq.begin(), seq.end(), std::back_inserter(result), fun);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
std::vector<T> filter(const std::vector<T>& seq, std::function<bool(T)> fun) {
|
std::vector<T> filter(const std::vector<T>& seq, std::function<bool(T)> fun) {
|
||||||
std::vector<T> result;
|
std::vector<T> result;
|
||||||
std::copy_if(seq.begin(), seq.end(), back_inserter(result), fun);
|
std::copy_if(seq.begin(), seq.end(), std::back_inserter(result), fun);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user