Victus Spiritus


M out of N

20 May 2011

c++ boost circular buffer and stl map and set example

In an effort to become more familiar with boost data structures (as opposed to homebrewed ones), I took a crack at M out of N validator. It checks the last N updates and determines if M passed a certain criteria. Not all members are updated at each interval, and they are identified by an ID pair of two longs.

A friend pointed me to a set implementation, and I happily added a set of members, which include IDs if they ever pass the M out of N test. The sample code includes a brief set of simulated data for testing.