title: Calculate rolling / moving average in C++
body: <p>I know this is achievable with boost as per:</p>
  
  <p><a href="https://stackoverflow.com/questions/5195990/using-boostaccumulators-how-can-i-reset-a-rolling-window-size-does-it-keep-e">Using boost::accumulators, how can I reset a rolling window size, does it keep extra history?</a></p>
  
  <p>But I really would like to avoid using boost. I have googled and not found any suitable or readable examples.</p>
  
  <p>Basically I want to track the moving average of an ongoing stream of a stream of floating point numbers using the most recent 1000 numbers as a data sample.</p>
  
  <p>What is the easiest way to achieve this?</p>
  
  <hr>
  
  <p>I experimented with using a circular array, exponential moving average and a more simple moving average and found that the results from the circular array suited my needs best.</p>