2020
09-29
09-29
C++98/11/17表达式类别(小结)
目标以下代码能否编译通过,能否按照期望运行?#include<utility>#include<type_traits>namespacecpp98{structA{};Afunc(){returnA();}intmain(){inti=1;i=2;//3=4;constintj=5;//j=6;i=j;func()=A();return0;}}namespacecpp11{#defineis_lvalue(x)std::is_lvalue_reference<decltype((x))>::value#defineis_prvalue(x)!std::is_reference<decltype((x))>::value#defineis_xvalue(x...
继续阅读 >