span-lite

C++20-like span library for C++98, C++11 and later

brewmacoslinux
Try with needOr install directly
Source

About

C++20-like span for C++98, C++11 and later in a single-file header-only library

Commands

span-lite

Examples

Include the header in a C++ project to use span functionality$ cat > example.cpp << 'EOF' #include "nonstd/span.hpp" #include <iostream> int main() { int arr[] = {1, 2, 3, 4, 5}; nonstd::span<int> s(arr); for(auto val : s) std::cout << val << " "; } EOF
Compile C++ code using span-lite header$ g++ -std=c++11 -I$(brew --prefix span-lite)/include example.cpp -o example
View the installed span.hpp header location$ brew --prefix span-lite