{
return &( m_buffer[0].v );
}
+
+ /// Returns <tt> idx % capacity() </tt>
+ /**
+ If the buffer size is a power of two, binary arithmethics is used
+ instead of modulo arithmetics
+ */
+ size_t mod( size_t idx )
+ {
+ static_if( c_bExp2 )
+ return idx & ( capacity() - 1 );
+ else
+ return idx % capacity();
+ }
};
/// Static initialized buffer
{
return m_buffer;
}
+
+ /// Returns <tt> idx % capacity() </tt>
+ /**
+ If the buffer size is a power of two, binary arithmethics is used
+ instead of modulo arithmetics
+ */
+ size_t mod( size_t idx )
+ {
+ static_if( c_bExp2 )
+ return idx & ( capacity() - 1 );
+ else
+ return idx % capacity();
+ }
};
/// Dynamically allocated uninitialized buffer
{
return m_buffer;
}
+
+ /// Returns <tt> idx % capacity() </tt>
+ /**
+ If the buffer size is a power of two, binary arithmethics is used
+ instead of modulo arithmetics
+ */
+ size_t mod( size_t idx )
+ {
+ static_if ( c_bExp2 )
+ return idx & ( capacity() - 1 );
+ else
+ return idx % capacity();
+ }
};
{
return m_buffer;
}
+
+ /// Returns <tt> idx % capacity() </tt>
+ /**
+ If the buffer size is a power of two, binary arithmethics is used
+ instead of modulo arithmetics
+ */
+ size_t mod( size_t idx )
+ {
+ static_if( c_bExp2 )
+ return idx & ( capacity() - 1 );
+ else
+ return idx % capacity();
+ }
};
} // namespace v