Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename C, typename N>>
- C<N> sqrts(const C<N> &xs) {
- C<N> r;
- remove_copy_if(xs.begin(), xs.end(), back_inserter(r), [](N i) { return i >= 0; }
- transform(r.begin(), r.end(), r.begin(), [](N i) { sqrt(i); });
- return r;
- }
Add Comment
Please, Sign In to add comment