Skip to content

Instantly share code, notes, and snippets.

@IceN9ne
Created March 23, 2017 21:07
Show Gist options
  • Save IceN9ne/3c52231d8ff3c42ec949fed812814799 to your computer and use it in GitHub Desktop.
Save IceN9ne/3c52231d8ff3c42ec949fed812814799 to your computer and use it in GitHub Desktop.
Insane fibonacci generator
auto fibonacciSequence(int maxValue)
{
std::vector<int> seq;
for (int i{0}, j{1}; i <= maxValue; j ^= i ^= j ^= i += j)
seq.push_back(i);
return seq;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment