The C ++ basic guidelines mention spans, not "multiple spans." But - I see that the Microsoft GSL implementation has a classmulti_span
multi_span
template < typename ValueType, std::ptrdiff_t FirstDimension, std::ptrdiff_t... RestDimensions > class multi_span { ... };
So, obviously, this is a kind of multi-dimensional version gsl::span. But what does this have to mean? Why do we need this multidimensional gap, or rather, when will we use it? I can not find documentation on this.
gsl::span
In short, this is a space in the adjacent part of the memory representing a multidimensional array.
Here is a usage example:
int data[6] = {0, 1, 2, 3, 4, 5}; multi_span<int, 2, 3> span{data, 6}; std::cout << span[1][1] << '\n'; //Outputs 4
, , .
Source: https://habr.com/ru/post/1681831/More articles:React Redux - Sending input value to submit - javascriptIonic 3 DateTime - Show selector with current date when model is undefined - angularПриоритет выражения индекса и выражения разыменования указателя - goClojurescript - map from the list of subvecs - clojureHow to handle bindings (bookmarks) using Vue Router? - vue.jsHow to change the last tick value in D3.js? - javascriptDelete the text before the second comma ('', ") String replace pattern - stringWavemulcor package - wave.multiple.cross.correlation function - replacement has a length of zero - rAngular Jasmine HTML Failure - node.jsIs it possible to sort multidimensional hashes using hash values of child elements? - ruby | fooobar.comAll Articles