Created
July 13, 2015 15:16
-
-
Save DieHertz/d848873130c6d90cce05 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 <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