reference binding

I already submitted a bug on that but nevertheless i want to know if other users met that problem.

Although Beta1 was conformant on that point in Beta 2 you can write something like this:

struct X{
   X(){}
   X(X&){}
};

int main{
   X& ref_to_X=X();
   X(X());
   return 0;
}

(etc more detail on the bug report)

that is non standard compliant(a rvalue must be bound to a const non volatile ref).

I was wondering if it is possible to have both beta1 and beta2 installed to crosstest some code.




Answer this question

reference binding

  • ShrinanD Vyas

    I don't believe that Beta-1 was confromant with binding temporaries to non-const references. We did try to fix this issue once but so much existing code broke that we decided to leave it alone. We do conform to the C++ Standard if you use the /Za cmd-line switch.

    I think that in a future version of the product we may add a specific switch to disable this "extension": something like:

    /Zc:strictRefBinding

    While it is not officially supported you should be able to have both Beta-1 and Beta-2 installed on the same machine (you may have to change the default install point for one of the Beta-2). I wouldn't guarantee that both IDEs will run smoothly but you should be able to use both of the compilers.



  • reference binding