1

I know that we must send reference to reference and we couldn't do like this:

void f (double& a);

f(10.1); // error

But we already have a project that send value instead of reference and it's compile with MSVC2017. How is this possible ?

Kate
  • 11
  • 1
  • Please show the code that is compiling with MSVC2017. Since that is the code you are asking about it makes sense to show that code. – john May 19 '20 at 06:39
  • 1
    This code is fine and it passes a value to a reference `void f (const double& a); f(10.1);`. Const makes the difference. – john May 19 '20 at 06:40

0 Answers0