constexpr range_difference_t<V> stride() const noexcept; // (1) C++23
概要
メンバ変数として保持している、歩幅を取得する。
効果
- (1) :
return stride_;
例
#include <ranges>
#include <vector>
#include <iostream>
int main() {
std::vector<int> v = {0, 1, 2, 3, 4, 5, 6, 7, 8};
std::ranges::stride_view sv{v, 3};
// 歩幅を取得
std::cout << "stride: " << sv.stride() << std::endl;
}
出力
stride: 3
バージョン
言語
- C++23
処理系
- Clang: 16.0 ✅
- GCC: 13.2 ✅
- Visual C++: 2022 Update 4 ✅