Sorry, but that's not actually true. There are no data races, the atomics prevent that (note that there are only one consumer and one producer)
Regarding the style, it follows the "almost always auto" idea from Herb Sutter
If you enforce that the buffer size is a power of 2 you just use a mask to do the
if (next_head == buffer.size()) next_head = 0;
If you enforce that the buffer size is a power of 2 you just use a mask to do the
part