Skip to content

Instantly share code, notes, and snippets.

@DieHertz
Created July 13, 2015 15:16
Show Gist options
  • Save DieHertz/d848873130c6d90cce05 to your computer and use it in GitHub Desktop.
Save DieHertz/d848873130c6d90cce05 to your computer and use it in GitHub Desktop.
#include <map>
#include <iostream>
struct range : std::pair<int, int> {
using std::pair<int, int>::pair;
void foo() const {
left = 10;
}
int& left = first;
int& right = second;
};
int main() {
// your code goes here
const range r{1, 2};
std::cout << r.first << ' ' << r.second << std::endl;
r.foo();
std::cout << r.first << ' ' << r.second << std::endl;
std::cout << sizeof r << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment