Skip to content

Latest commit

 

History

History
50 lines (39 loc) · 1.06 KB

File metadata and controls

50 lines (39 loc) · 1.06 KB

enable_borrowed_range

  • ranges[meta header]
  • std::ranges[meta namespace]
  • variable[meta id-type]
  • cpp20[meta cpp]
namespace std::ranges {
  template<class I, class S, subrange_kind K>
  inline constexpr bool enable_borrowed_range<subrange<I, S, K>> = true;
}
  • subrange[link ../subrange.md]

概要

enable_borrowed_rangeの特殊化。

この特殊化により、subrangeborrowed_rangeとなる。

#include <ranges>

int main()
{
  constexpr int a[] = {1, 2};
  const std::ranges::subrange sub(a);
  static_assert(std::ranges::borrowed_range<decltype(sub)>);
}

出力

バージョン

言語

  • C++20

処理系

参照