26 #ifndef MLN_ACCU_STAT_RANK_BOOL_HH
27 # define MLN_ACCU_STAT_RANK_BOOL_HH
38 # include <mln/accu/internal/base.hh>
51 template <
typename T>
struct rank;
58 struct rank<bool> :
public mln::accu::internal::base< bool, rank<bool> >
60 typedef bool argument;
68 void take_as_init_(
const argument& t);
69 void take(
const argument& t);
71 void untake(
const argument& t);
88 # ifndef MLN_INCLUDE_ONLY
97 rank<bool>::rank(
unsigned k)
117 void rank<bool>::take(
const argument& t)
124 void rank<bool>::untake(
const argument& t)
128 mln_assertion(nfalse_ > 0);
135 rank<bool>::take(
const rank<bool>& other)
137 nfalse_ += other.nfalse_;
142 rank<bool>::untake(
const rank<bool>& other)
144 mln_precondition(other.nfalse_ <= nfalse_);
145 nfalse_ -= other.nfalse_;
152 return k_ >= nfalse_;
162 # endif // ! MLN_INCLUDE_ONLY
171 #endif // ! MLN_ACCU_STAT_RANK_BOOL_HH