Created
April 18, 2017 10:24
-
-
Save deque-blog/c6b0ef182797b90dc29640af4df1f224 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
// Square number generator | |
auto square_gen = | |
transform_gen([](int i) { return i * i; }, int_gen(0, 10)); | |
// Testing in std::cout | |
for (int i = 0; i < 10; ++i) | |
std::cout << square_gen(bit_gen) << ","; | |
std::cout << '\n'; | |
// Outputs: | |
// 64,36,9,16,81,0,100,64,64,25, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment