在c中的int x = x;
lvalue to-to-to-to-rvalue轉換
的證據,儘管在標准上沒有明確要求,因此,各種操作者都暗示了構建的主要作戰者。例如,標準指出,內置分配運算符需要對正確操作數的LVALUE到RVALUE轉換。其他規定還表明,通常預期的是,除非明確指定另有說明。dialition與分配的含義分類可能擴展到該區域的歧義。 Evidence suggests that the intended specification is to expect prvalues wherever a value is needed.
Consequences for int x = x;Assuming the conjecture holds true, initializing x with itself would require lvalue-to-rvalue conversion on an uninitialized value, leading to undefined behavior.
Supporting EvidencesFurther evidence arises from the consideration of code that assigns uninitialized variables with different types and different assignments.不一致的行為,例如防止參考初始化的含量到比值轉換,但允許對像初始化,這為lvalue to-rvalue轉換預期是否可以進行拷貝啟動。 LVALUE到值轉換。這表明在諸如int x = x;。
結論[&& && &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&讀的證據[&& && &&&&&& && && hercvalsive Insess int int ointizited Intike Inted Inte Intik是很合理少)反過來,由於右手X的非直接性質,這導致了不確定的行為。該標準的不一致和需要澄清的不一致強調了對價值類別的詳細規範的重要性。
免責聲明: 提供的所有資源部分來自互聯網,如果有侵犯您的版權或其他權益,請說明詳細緣由並提供版權或權益證明然後發到郵箱:[email protected] 我們會在第一時間內為您處理。
Copyright© 2022 湘ICP备2022001581号-3