cwidget  0.5.17
bool_accumulate.h
1 // bool_accumulate.h -*-c++-*-
2 //
3 // Copyright 2005 Daniel Burrows
4 
5 #ifndef BOOL_ACCUMULATE
6 #define BOOL_ACCUMULATE
7 
8 namespace cwidget
9 {
10  namespace util
11  {
16  {
17  typedef bool result_type;
18  template<typename T_iterator>
19  result_type operator()(T_iterator first, T_iterator last) const
20  {
21  for(; first!=last; ++first)
22  if(!*first)
23  return false;
24 
25  return true;
26  }
27  };
28 
33  {
34  typedef bool result_type;
35  template<typename T_iterator>
36  result_type operator()(T_iterator first, T_iterator last) const
37  {
38  for(; first!=last; ++first)
39  if(*first)
40  return true;
41 
42  return false;
43  }
44  };
45  }
46 }
47 
48 #endif
Computes the return-value of the signal via a short-circuiting OR.
Definition: bool_accumulate.h:32
The namespace containing everything defined by cwidget.
Definition: columnify.cc:26
Computes the return-value of the signal via a short-circuiting AND.
Definition: bool_accumulate.h:15