9 #ifndef META_STATS_STATISTICS_H_
10 #define META_STATS_STATISTICS_H_
13 #include <type_traits>
31 template <
class Dist,
class Fun>
34 using T =
typename std::remove_reference<Dist>::type::event_type;
36 dist.each_seen_event([&](
const T& event)
38 total += dist.probability(event) * fun(event);
52 using T =
typename std::remove_reference<Dist>::type::event_type;
55 return -std::log2(dist.probability(event));