名稱空間
變體
操作

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

來自 cppreference.com
 
 
範圍庫 (Ranges library)
範圍介面卡 (Range adaptors)
 
 
constexpr decltype(auto) operator[]( difference_type n ) const
  requires ranges::random_access_range<Base>;
(C++20 起)

返回指定相對位置處經過轉換後的元素。

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

[編輯] 引數

n - 相對於當前位置的偏移。

[編輯] 返回值

轉換後的元素

[編輯] 示例