In C++ it is possible to bind a temporary to a const reference:
struct A {};
int main() {
const A& a = A();
}
Is there any way to disable this for some particular class A so that it would be impossible to bind a temporary of this class to a const reference?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…