Created
December 8, 2012 17:05
-
-
Save lvv/4241049 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 <sto/sto.h> | |
using namespace sto; | |
#include <vector> | |
#include <iostream> | |
using namespace std; | |
int main() { | |
// no need for clumsy iota (is covertable to any STL container) | |
vector<int> V = range(10); | |
for (int x:V) cout << x << " "; cout << endl; | |
// is lazy, works with STL algorighms | |
auto NR = range(1,999999999999999999l); | |
cout << *find(NR.begin(), NR.end(), 5) << endl; | |
// any arithmetic type | |
for (auto x : range(0,1,0.2)) cout << x << " "; cout << endl; | |
for (char c : range('a','z')) cout << c << " "; cout << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment