Is there a way to disable binding a temporary to a const reference?

前端 未结 2 589
广开言路
广开言路 2020-12-21 15:45

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 di

2条回答
提交回复
热议问题