开发者

Do rvalue references allow implicit conversions?

开发者 https://www.devze.com 2023-01-04 16:33 出处:网络
Is the following code le开发者_如何学JAVAgal? std::string&& x = \"hello world\"; g++ 4.5.0 compiles this code without any problems.This is discussed on usenet currently. See Rvalue referenc

Is the following code le开发者_如何学JAVAgal?

std::string&& x = "hello world";

g++ 4.5.0 compiles this code without any problems.


This is discussed on usenet currently. See Rvalue reference example in 8.5/3 correct or wrong?.

It's not legal.

0

精彩评论

暂无评论...
验证码 换一张
取 消