草庐IT

c++ - 何时在 C++14 中使用变量 odr?

C++14草案(N3936)在§3.2/3中声明:Avariablexwhosenameappearsasapotentially-evaluatedexpressionexisodr-usedunlessapplyingthelvalue-to-rvalueconversion(4.1)toxyieldsaconstantexpression(5.19)thatdoesnotinvokeanynon-trivialfunctionsand,ifxisanobject,exisanelementofthesetofpotentialresultsofanexpressione,wher

c++ - 何时在 C++14 中使用变量 odr?

C++14草案(N3936)在§3.2/3中声明:Avariablexwhosenameappearsasapotentially-evaluatedexpressionexisodr-usedunlessapplyingthelvalue-to-rvalueconversion(4.1)toxyieldsaconstantexpression(5.19)thatdoesnotinvokeanynon-trivialfunctionsand,ifxisanobject,exisanelementofthesetofpotentialresultsofanexpressione,wher