Skip to content

Instantly share code, notes, and snippets.

@cammckinnon
Created June 3, 2012 22:00
Show Gist options
  • Save cammckinnon/2865174 to your computer and use it in GitHub Desktop.
Save cammckinnon/2865174 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <vector>
std::vector<bool> v;
bool& first() {
return v[0];
}
int main() {
v.push_back(true);
bool& r = first();
r = false;
std::cout << v[0] << "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment