Auxiliary Arithmetic Algorithms
logical_or.hpp
1 #pragma once
2 
3 #include <algorithm>
4 #include <functional>
5 
6 namespace aaa {
7 
30 template<typename InputIterator1, typename InputIterator2, typename OutputIterator>
31 void logical_or(InputIterator1 first_left, InputIterator1 last_left, InputIterator2 first_right, OutputIterator first_out)
32 {
33  std::transform(first_left, last_left, first_right, first_out, std::logical_or<bool>());
34 }
35 
36 template<typename Container1, typename Container2, typename Container3>
37 void logical_or(const Container1& left, const Container2& right, Container3& out)
38 {
39  using namespace std;
40  aaa::logical_or(begin(left), end(left), begin(right), begin(out));
41 }
42 
43 template<typename Container>
44 Container logical_or(const Container& left, const Container& right)
45 {
46  auto out = left;
47  aaa::logical_or(left, right, out);
48  return out;
49 }
50 
53 } // namespace aaa
Definition: add.hpp:7