Created
January 1, 2020 20:36
-
-
Save JohanMabille/588c301c57f12df3ccb4ee185ea7b959 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <size_t dim = 0, class S> | |
auto raw_data_offset(const S&) noexcept | |
{ | |
return typename S::value_type(0); | |
} | |
template <size_t dim = 0, class S, class I, class... Args> | |
auto raw_data_offset(const S& strides, I i, Args... args) noexcept | |
{ | |
return i * strides[dim] + raw_data_offset<dim + 1>(strides, | |
args...); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment