Skip to content

Instantly share code, notes, and snippets.

@swkpku
Last active November 5, 2018 03:50
Show Gist options
  • Save swkpku/87a517d08ce9500de156d9c173696465 to your computer and use it in GitHub Desktop.
Save swkpku/87a517d08ce9500de156d9c173696465 to your computer and use it in GitHub Desktop.
我就是程序员 第一季 第一期
#include <map>
class R {
};
class S {
R &m_r;
public:
S(R &r): m_r(r) {
}
};
void InsertIfNotExists(std::map<int, S> &m, int i, R &r) {
if (m.find(i) == m.end())
m[i] = S(r);
}
// Compiler: line 16: error C2280: 'S &S::operator=(const S &)': attempting to reference a deleted function
// Please fix this code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment