名稱空間
變體
操作

std::ranges::transform_view<V,F>::iterator<Const>::operator*

來自 cppreference.com
 
 
範圍庫 (Ranges library)
範圍介面卡 (Range adaptors)
 
 
constexpr decltype(auto) operator*() const;
(C++20 起)

返回轉換後的元素。

實際返回 std::invoke(*parent_->fun_, *current_),其中 *parent_->fun_ 是儲存在父 transform_view 中的轉換函式,current_ 是指向 V 的底層迭代器。

目錄

[編輯] 引數

(無)

[編輯] 返回值

轉換後的元素。

[編輯] 注意

未提供 operator->

如果指向父 transform_view 的指標為空(例如,如果 *this 是預設構造的),則行為未定義。

如果 *current_ 是一個純右值,其生命週期在此函式返回之前結束。如果轉換函式返回對其的引用或指標,則結果將懸空。

[編輯] 示例