Created
February 3, 2018 11:30
-
-
Save Leandros/69268e768f8a30c85dee1c6861b3d145 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Dimen> | |
class NDMatrix | |
{ | |
public: | |
/* this is imaginary, as of right now: */ | |
$for(size_t i = 0; i < Dimen; ++i) { | |
/* Create one function definition for each dimen access: | |
* float &At(int x0, int x1, etc...) { return m_array[_At(...)]; } | |
*/ | |
} | |
private: | |
size_t | |
_At(int indices[Dimen]) | |
{ | |
/* calculate the correct index for access into linear array here . */ | |
return idx; | |
} | |
}; | |
/* ... */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment