* @brief Provides a base class for common operations with raw buffer
*
* For classes that handle a raw buffer of data, this will provide common operations such as equals, printing, and visitors.
* To use this class the derived class needs to provide a `data()` method to retrieve a raw pointer to the data, and `get_shape` method that provides the shape of the data.
*
*/
template<classDerived>
template<classDerived>
structraw_data
structraw_data
{
{
...
@@ -37,6 +44,12 @@ struct raw_data
...
@@ -37,6 +44,12 @@ struct raw_data
returnos;
returnos;
}
}
/**
* @brief Visits a single data element at a certain index.
*
* @param v A function which will be called with the type of data