Auxiliary Arithmetic Algorithms
logical_not.hpp
1 #pragma once
2 
3 #include <algorithm>
4 #include <functional>
5 
6 namespace aaa {
7 
28 template<typename InputIterator, typename OutputIterator>
29 void logical_not(InputIterator first_in, InputIterator last_in, OutputIterator first_out)
30 {
31  std::transform(first_in, last_in, first_out, std::logical_not<bool>());
32 }
33 
34 template<typename Container1, typename Container2>
35 void logical_not(const Container1& in, Container2& out)
36 {
37  using namespace std;
38  aaa::logical_not(begin(in), end(in), begin(out));
39 }
40 
41 template<typename Container>
42 Container logical_not(const Container& in)
43 {
44  auto out = in;
45  aaa::logical_not(in, out);
46  return out;
47 }
48 
51 } // namespace aaa
Definition: add.hpp:7