![](/img/trans.png)
[英]Why do left operands of logical AND/OR not carry dependency to the parent evaluation?
根據C++標准: 如果 - 將 A 的值用作 B 的操作數,則評估 A 對評估 B 具有依賴性,除非: — B 是對 std::kill_dependency (29.3) 的任何特化的調用,或 — A 是內置邏輯 AND(&&,參見 5.14)或邏輯 OR(||,參見 5.15 ...
[英]Why do left operands of logical AND/OR not carry dependency to the parent evaluation?
根據C++標准: 如果 - 將 A 的值用作 B 的操作數,則評估 A 對評估 B 具有依賴性,除非: — B 是對 std::kill_dependency (29.3) 的任何特化的調用,或 — A 是內置邏輯 AND(&&,參見 5.14)或邏輯 OR(||,參見 5.15 ...
[英]Why isn't [[carries_dependency]] the default in C++?
我知道memory_order_consume已被棄用,但我試圖了解原始設計中的邏輯以及[[carries_dependency]]和kill_dependency應該如何工作。 為此,我想要一個特定的代碼示例,它會在 IBM PowerPC 或 DEC alpha 或什至具有假設編譯器的假設架構 ...
[英][[carries_dependency]] what it means and how to implement
我在這篇SO帖子中閱讀了 [[carries_dependency]]。 但我無法理解的是接受的答案中的以下句子: “特別是,如果將使用 memory_order_consume 讀取的值傳遞給函數,然后沒有 [[carries_dependency]],那么編譯器可能必須發出內存柵欄指令 ...
[英]When should you not use [[carries_dependency]]?
我發現了一些問題(比如這個)詢問[[carries_dependency]]做什么,這不是我在這里問的。 我想知道你什么時候不應該使用它,因為我讀過的所有答案都讓人覺得你可以把這段代碼貼在任何地方,而且你會神奇地得到相等或更快的代碼。 一個評論說代碼可以相等或更慢,但海報沒有詳細說明。 我想在任 ...
[英]In C++11, how do I specify that the implicit "this" parameter "[[carries_dependency]]"?
在[dcl.attr.depend]/1 中,我讀到: 屬性[...] carries_dependency [...] 可以應用於函數聲明或 lambda 中parameter-declaration的declarator-id ,在這種情況下,它指定參數的初始化攜帶對 (1.10 ) 該對 ...
[英]What does the [[carries_dependency]] attribute mean?
有人能用凡人懂的語言來解釋嗎? ...