Skip to content

Instantly share code, notes, and snippets.

@JohanMabille
Created December 28, 2019 22:22
Show Gist options
  • Save JohanMabille/541c075d7a724664a9c755b9cb5cb681 to your computer and use it in GitHub Desktop.
Save JohanMabille/541c075d7a724664a9c755b9cb5cb681 to your computer and use it in GitHub Desktop.
template <class T, class A = std::allocator<T>>
class xarray
{
public:
// ... as before
using strides_type = shape_type;
using storage_type = std::vector<T, A>;
void resize(const shape_type& shape, const strides_type& strides);
void reshape(const shape_type& shape, const strides_type& strides);
private:
shape_type m_shape;
strides_type m_strides;
storage_type m_storage;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment