Created
April 12, 2018 19:20
-
-
Save loliGothicK/e174fb72896b0320e55440aa70b5513a 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
#include <array> | |
#include <utility> | |
#include <iostream> | |
template < std::size_t N > | |
constexpr auto ints = []{ | |
std::array<std::size_t, N> arr{}; | |
for( std::size_t i{}; i < N; ++i ) arr[i] = i; | |
return arr; | |
}(); | |
int main() { | |
constexpr auto range = ints<10>; | |
for(auto elem: range) std::cout << elem << " "; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment