Skip to content

Instantly share code, notes, and snippets.

@danlark1

danlark1/pair_assignment.h

Last active Apr 13, 2020
Embed
What would you like to do?
template <typename T, typename U>
struct pair {
T first;
U second;
};
int main() {
int x = 10;
int y = 20;
pair<int&, int> p{x, x};
pair<int&, int> p1{y, y};
p1 = p; // ill-formed, with std::pair, well-formed
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.