range_fwd.hpp 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941
  1. /// \file
  2. // Range v3 library
  3. //
  4. // Copyright Eric Niebler 2013-present
  5. //
  6. // Use, modification and distribution is subject to the
  7. // Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt)
  10. //
  11. // Project home: https://github.com/ericniebler/range-v3
  12. //
  13. #ifndef RANGES_V3_RANGE_FWD_HPP
  14. #define RANGES_V3_RANGE_FWD_HPP
  15. #include <type_traits>
  16. #include <utility>
  17. #include <meta/meta.hpp>
  18. #include <concepts/concepts.hpp>
  19. #include <concepts/compare.hpp>
  20. #include <range/v3/detail/config.hpp>
  21. #include <range/v3/utility/static_const.hpp>
  22. #include <range/v3/version.hpp>
  23. /// \defgroup group-iterator Iterator
  24. /// Iterator functionality
  25. /// \defgroup group-iterator-concepts Iterator Concepts
  26. /// \ingroup group-iterator
  27. /// Iterator concepts
  28. /// \defgroup group-range Range
  29. /// Core range functionality
  30. /// \defgroup group-range-concepts Range Concepts
  31. /// \ingroup group-range
  32. /// Range concepts
  33. /// \defgroup group-algorithms Algorithms
  34. /// Iterator- and range-based algorithms, like the standard algorithms
  35. /// \defgroup group-views Views
  36. /// Lazy, non-owning, non-mutating, composable range views
  37. /// \defgroup group-actions Actions
  38. /// Eager, mutating, composable algorithms
  39. /// \defgroup group-utility Utility
  40. /// Utility classes
  41. /// \defgroup group-functional Functional
  42. /// Function and function object utilities
  43. /// \defgroup group-numerics Numerics
  44. /// Numeric utilities
  45. #include <range/v3/detail/prologue.hpp>
  46. RANGES_DIAGNOSTIC_PUSH
  47. RANGES_DIAGNOSTIC_IGNORE_CXX17_COMPAT
  48. namespace ranges
  49. {
  50. /// \cond
  51. namespace views
  52. {
  53. }
  54. namespace actions
  55. {
  56. }
  57. // GCC either fails to accept an attribute on a namespace, or else
  58. // it ignores the deprecation attribute. Frustrating.
  59. #if(RANGES_CXX_VER < RANGES_CXX_STD_17 || defined(__GNUC__) && !defined(__clang__))
  60. inline namespace v3
  61. {
  62. using namespace ranges;
  63. }
  64. namespace view = views;
  65. namespace action = actions;
  66. #else
  67. inline namespace RANGES_DEPRECATED(
  68. "The name ranges::v3 namespace is deprecated. "
  69. "Please discontinue using it.") v3
  70. {
  71. using namespace ranges;
  72. }
  73. namespace RANGES_DEPRECATED(
  74. "The ranges::view namespace has been renamed to ranges::views. "
  75. "(Sorry!)") view
  76. {
  77. using namespace views;
  78. }
  79. namespace RANGES_DEPRECATED(
  80. "The ranges::action namespace has been renamed to ranges::actions. "
  81. "(Sorry!)") action
  82. {
  83. using namespace actions;
  84. }
  85. #endif
  86. namespace _end_
  87. {
  88. struct fn;
  89. }
  90. using end_fn = _end_::fn;
  91. namespace _size_
  92. {
  93. struct fn;
  94. }
  95. template<typename>
  96. struct result_of;
  97. template<typename Sig>
  98. using result_of_t RANGES_DEPRECATED(
  99. "ranges::result_of_t is deprecated. "
  100. "Please use ranges::invoke_result_t") = meta::_t<result_of<Sig>>;
  101. /// \endcond
  102. template<typename...>
  103. struct variant;
  104. struct dangling;
  105. struct make_pipeable_fn;
  106. struct pipeable_base;
  107. template<typename First, typename Second>
  108. struct composed;
  109. template<typename... Fns>
  110. struct overloaded;
  111. namespace actions
  112. {
  113. template<typename ActionFn>
  114. struct action_closure;
  115. }
  116. namespace views
  117. {
  118. template<typename ViewFn>
  119. struct view_closure;
  120. }
  121. struct advance_fn;
  122. struct advance_to_fn;
  123. struct advance_bounded_fn;
  124. struct next_fn;
  125. struct prev_fn;
  126. struct distance_fn;
  127. struct iter_size_fn;
  128. template<typename T>
  129. struct indirectly_readable_traits;
  130. template<typename T>
  131. using readable_traits RANGES_DEPRECATED("Please use ranges::indirectly_readable_traits")
  132. = indirectly_readable_traits<T>;
  133. template<typename T>
  134. struct incrementable_traits;
  135. struct view_base
  136. {};
  137. /// \cond
  138. namespace detail
  139. {
  140. template<typename T>
  141. struct difference_type_;
  142. template<typename T>
  143. struct value_type_;
  144. } // namespace detail
  145. template<typename T>
  146. using difference_type RANGES_DEPRECATED(
  147. "ranges::difference_type<T>::type is deprecated. Use "
  148. "ranges::incrementable_traits<T>::difference_type instead.") =
  149. detail::difference_type_<T>;
  150. template<typename T>
  151. using value_type RANGES_DEPRECATED(
  152. "ranges::value_type<T>::type is deprecated. Use "
  153. "ranges::indirectly_readable_traits<T>::value_type instead.") = detail::value_type_<T>;
  154. template<typename T>
  155. struct size_type;
  156. /// \endcond
  157. /// \cond
  158. namespace detail
  159. {
  160. struct ignore_t
  161. {
  162. ignore_t() = default;
  163. template<typename T>
  164. constexpr ignore_t(T &&) noexcept
  165. {}
  166. template<typename T>
  167. constexpr ignore_t const & operator=(T &&) const noexcept
  168. {
  169. return *this;
  170. }
  171. };
  172. struct value_init
  173. {
  174. template<typename T>
  175. operator T() const
  176. {
  177. return T{};
  178. }
  179. };
  180. struct make_compressed_pair_fn;
  181. template<typename T>
  182. constexpr meta::_t<std::remove_reference<T>> && move(T && t) noexcept
  183. {
  184. return static_cast<meta::_t<std::remove_reference<T>> &&>(t);
  185. }
  186. struct as_const_fn
  187. {
  188. template<typename T>
  189. constexpr T const & operator()(T & t) const noexcept
  190. {
  191. return t;
  192. }
  193. template<typename T>
  194. constexpr T const && operator()(T && t) const noexcept
  195. {
  196. return (T &&) t;
  197. }
  198. };
  199. RANGES_INLINE_VARIABLE(as_const_fn, as_const)
  200. template<typename T>
  201. using as_const_t = decltype(as_const(std::declval<T>()));
  202. template<typename T>
  203. using decay_t = meta::_t<std::decay<T>>;
  204. template<typename T, typename R = meta::_t<std::remove_reference<T>>>
  205. using as_ref_t =
  206. meta::_t<std::add_lvalue_reference<meta::_t<std::remove_const<R>>>>;
  207. template<typename T, typename R = meta::_t<std::remove_reference<T>>>
  208. using as_cref_t = meta::_t<std::add_lvalue_reference<R const>>;
  209. struct get_first;
  210. struct get_second;
  211. template<typename Val1, typename Val2>
  212. struct replacer_fn;
  213. template<typename Pred, typename Val>
  214. struct replacer_if_fn;
  215. template<typename I>
  216. struct move_into_cursor;
  217. template<typename Int>
  218. struct from_end_;
  219. template<typename... Ts>
  220. constexpr int ignore_unused(Ts &&...)
  221. {
  222. return 42;
  223. }
  224. template<int I>
  225. struct priority_tag : priority_tag<I - 1>
  226. {};
  227. template<>
  228. struct priority_tag<0>
  229. {};
  230. #if defined(__clang__) && !defined(_LIBCPP_VERSION)
  231. template<typename T, typename... Args>
  232. RANGES_INLINE_VAR constexpr bool is_trivially_constructible_v =
  233. __is_trivially_constructible(T, Args...);
  234. template<typename T>
  235. RANGES_INLINE_VAR constexpr bool is_trivially_default_constructible_v =
  236. is_trivially_constructible_v<T>;
  237. template<typename T>
  238. RANGES_INLINE_VAR constexpr bool is_trivially_copy_constructible_v =
  239. is_trivially_constructible_v<T, T const &>;
  240. template<typename T>
  241. RANGES_INLINE_VAR constexpr bool is_trivially_move_constructible_v =
  242. is_trivially_constructible_v<T, T>;
  243. template<typename T>
  244. RANGES_INLINE_VAR constexpr bool is_trivially_copyable_v =
  245. __is_trivially_copyable(T);
  246. template<typename T, typename U>
  247. RANGES_INLINE_VAR constexpr bool is_trivially_assignable_v =
  248. __is_trivially_assignable(T, U);
  249. template<typename T>
  250. RANGES_INLINE_VAR constexpr bool is_trivially_copy_assignable_v =
  251. is_trivially_assignable_v<T &, T const &>;
  252. template<typename T>
  253. RANGES_INLINE_VAR constexpr bool is_trivially_move_assignable_v =
  254. is_trivially_assignable_v<T &, T>;
  255. template<typename T, typename... Args>
  256. struct is_trivially_constructible
  257. : meta::bool_<is_trivially_constructible_v<T, Args...>>
  258. {};
  259. template<typename T>
  260. struct is_trivially_default_constructible
  261. : meta::bool_<is_trivially_default_constructible_v<T>>
  262. {};
  263. template<typename T>
  264. struct is_trivially_copy_constructible
  265. : meta::bool_<is_trivially_copy_constructible_v<T>>
  266. {};
  267. template<typename T>
  268. struct is_trivially_move_constructible
  269. : meta::bool_<is_trivially_move_constructible_v<T>>
  270. {};
  271. template<typename T>
  272. struct is_trivially_copyable
  273. : meta::bool_<is_trivially_copyable_v<T>>
  274. {};
  275. template<typename T, typename U>
  276. struct is_trivially_assignable
  277. : meta::bool_<is_trivially_assignable_v<T, U>>
  278. {};
  279. template<typename T>
  280. struct is_trivially_copy_assignable
  281. : meta::bool_<is_trivially_copy_assignable_v<T>>
  282. {};
  283. template<typename T>
  284. struct is_trivially_move_assignable
  285. : meta::bool_<is_trivially_move_assignable_v<T>>
  286. {};
  287. #else
  288. using std::is_trivially_constructible;
  289. using std::is_trivially_default_constructible;
  290. using std::is_trivially_copy_assignable;
  291. using std::is_trivially_copy_constructible;
  292. using std::is_trivially_copyable;
  293. using std::is_trivially_assignable;
  294. using std::is_trivially_move_assignable;
  295. using std::is_trivially_move_constructible;
  296. #if META_CXX_TRAIT_VARIABLE_TEMPLATES
  297. using std::is_trivially_constructible_v;
  298. using std::is_trivially_default_constructible_v;
  299. using std::is_trivially_copy_assignable_v;
  300. using std::is_trivially_copy_constructible_v;
  301. using std::is_trivially_copyable_v;
  302. using std::is_trivially_assignable_v;
  303. using std::is_trivially_move_assignable_v;
  304. using std::is_trivially_move_constructible_v;
  305. #else
  306. template<typename T, typename... Args>
  307. RANGES_INLINE_VAR constexpr bool is_trivially_constructible_v =
  308. is_trivially_constructible<T, Args...>::value;
  309. template<typename T>
  310. RANGES_INLINE_VAR constexpr bool is_trivially_default_constructible_v =
  311. is_trivially_default_constructible<T>::value;
  312. template<typename T>
  313. RANGES_INLINE_VAR constexpr bool is_trivially_copy_constructible_v =
  314. is_trivially_copy_constructible<T>::value;
  315. template<typename T>
  316. RANGES_INLINE_VAR constexpr bool is_trivially_move_constructible_v =
  317. is_trivially_move_constructible<T>::value;
  318. template<typename T>
  319. RANGES_INLINE_VAR constexpr bool is_trivially_copyable_v =
  320. is_trivially_copyable<T>::value;
  321. template<typename T, typename U>
  322. RANGES_INLINE_VAR constexpr bool is_trivially_assignable_v =
  323. is_trivially_assignable<T, U>::value;
  324. template<typename T>
  325. RANGES_INLINE_VAR constexpr bool is_trivially_copy_assignable_v =
  326. is_trivially_copy_assignable<T>::value;
  327. template<typename T>
  328. RANGES_INLINE_VAR constexpr bool is_trivially_move_assignable_v =
  329. is_trivially_move_assignable<T>::value;
  330. #endif
  331. #endif
  332. template<typename T>
  333. RANGES_INLINE_VAR constexpr bool is_trivial_v =
  334. is_trivially_copyable_v<T> &&
  335. is_trivially_default_constructible_v<T>;
  336. template<typename T>
  337. struct is_trivial
  338. : meta::bool_<is_trivial_v<T>>
  339. {};
  340. #if RANGES_CXX_LIB_IS_FINAL > 0
  341. #if defined(__clang__) && !defined(_LIBCPP_VERSION)
  342. template<typename T>
  343. RANGES_INLINE_VAR constexpr bool is_final_v = __is_final(T);
  344. template<typename T>
  345. struct is_final
  346. : meta::bool_<is_final_v<T>>
  347. {};
  348. #else
  349. using std::is_final;
  350. #if META_CXX_TRAIT_VARIABLE_TEMPLATES
  351. using std::is_final_v;
  352. #else
  353. template<typename T>
  354. RANGES_INLINE_VAR constexpr bool is_final_v = is_final<T>::value;
  355. #endif
  356. #endif
  357. #else
  358. template<typename T>
  359. RANGES_INLINE_VAR constexpr bool is_final_v = false;
  360. template<typename T>
  361. using is_final = std::false_type;
  362. #endif
  363. // Work around libc++'s buggy std::is_function
  364. // Function types here:
  365. template<typename T>
  366. char (&is_function_impl_(priority_tag<0>))[1];
  367. // Array types here:
  368. template<typename T, typename = decltype((*(T *)0)[0])>
  369. char (&is_function_impl_(priority_tag<1>))[2];
  370. // Anything that can be returned from a function here (including
  371. // void and reference types):
  372. template<typename T, typename = T (*)()>
  373. char (&is_function_impl_(priority_tag<2>))[3];
  374. // Classes and unions (including abstract types) here:
  375. template<typename T, typename = int T::*>
  376. char (&is_function_impl_(priority_tag<3>))[4];
  377. template<typename T>
  378. RANGES_INLINE_VAR constexpr bool is_function_v =
  379. sizeof(detail::is_function_impl_<T>(priority_tag<3>{})) == 1;
  380. template<typename T>
  381. struct remove_rvalue_reference
  382. {
  383. using type = T;
  384. };
  385. template<typename T>
  386. struct remove_rvalue_reference<T &&>
  387. {
  388. using type = T;
  389. };
  390. template<typename T>
  391. using remove_rvalue_reference_t = meta::_t<remove_rvalue_reference<T>>;
  392. // Workaround bug in the Standard Library:
  393. // From cannot be an incomplete class type despite that
  394. // is_convertible<X, Y> should be equivalent to is_convertible<X&&, Y>
  395. // in such a case.
  396. template<typename From, typename To>
  397. using is_convertible =
  398. std::is_convertible<meta::_t<std::add_rvalue_reference<From>>, To>;
  399. } // namespace detail
  400. /// \endcond
  401. struct begin_tag
  402. {};
  403. struct end_tag
  404. {};
  405. struct copy_tag
  406. {};
  407. struct move_tag
  408. {};
  409. template<typename T>
  410. using uncvref_t = meta::_t<std::remove_cv<meta::_t<std::remove_reference<T>>>>;
  411. struct not_equal_to;
  412. struct equal_to;
  413. struct less;
  414. #if __cplusplus > 201703L && __has_include(<compare>) && \
  415. defined(__cpp_concepts) && defined(__cpp_impl_three_way_comparison)
  416. struct compare_three_way;
  417. #endif // __cplusplus
  418. struct identity;
  419. template<typename Pred>
  420. struct logical_negate;
  421. enum cardinality : std::ptrdiff_t
  422. {
  423. infinite = -3,
  424. unknown = -2,
  425. finite = -1
  426. };
  427. template<typename Rng, typename Void = void>
  428. struct range_cardinality;
  429. template<typename Rng>
  430. using is_finite = meta::bool_<range_cardinality<Rng>::value >= finite>;
  431. template<typename Rng>
  432. using is_infinite = meta::bool_<range_cardinality<Rng>::value == infinite>;
  433. template<typename S, typename I>
  434. RANGES_INLINE_VAR constexpr bool disable_sized_sentinel = false;
  435. template<typename R>
  436. RANGES_INLINE_VAR constexpr bool enable_borrowed_range = false;
  437. namespace detail
  438. {
  439. template<typename R>
  440. RANGES_DEPRECATED("Please use ranges::enable_borrowed_range instead.")
  441. RANGES_INLINE_VAR constexpr bool enable_safe_range = enable_borrowed_range<R>;
  442. } // namespace detail
  443. using detail::enable_safe_range;
  444. template<typename Cur>
  445. struct basic_mixin;
  446. template<typename Cur>
  447. struct RANGES_EMPTY_BASES basic_iterator;
  448. template<cardinality>
  449. struct basic_view : view_base
  450. {};
  451. template<typename Derived, cardinality C = finite>
  452. struct view_facade;
  453. template<typename Derived, typename BaseRng,
  454. cardinality C = range_cardinality<BaseRng>::value>
  455. struct view_adaptor;
  456. template<typename I, typename S>
  457. struct common_iterator;
  458. /// \cond
  459. namespace detail
  460. {
  461. template<typename I>
  462. struct cpp17_iterator_cursor;
  463. template<typename I>
  464. using cpp17_iterator = basic_iterator<cpp17_iterator_cursor<I>>;
  465. } // namespace detail
  466. /// \endcond
  467. template<typename First, typename Second>
  468. struct compressed_pair;
  469. template<typename T>
  470. struct bind_element;
  471. template<typename T>
  472. using bind_element_t = meta::_t<bind_element<T>>;
  473. template<typename Derived, cardinality = finite>
  474. struct view_interface;
  475. template<typename T>
  476. struct istream_view;
  477. template<typename I, typename S = I>
  478. struct RANGES_EMPTY_BASES iterator_range;
  479. template<typename I, typename S = I>
  480. struct sized_iterator_range;
  481. template<typename T>
  482. struct reference_wrapper;
  483. // Views
  484. //
  485. template<typename Rng, typename Pred>
  486. struct RANGES_EMPTY_BASES adjacent_filter_view;
  487. namespace views
  488. {
  489. struct adjacent_filter_fn;
  490. }
  491. template<typename Rng, typename Pred>
  492. struct RANGES_EMPTY_BASES adjacent_remove_if_view;
  493. namespace views
  494. {
  495. struct adjacent_remove_if_fn;
  496. }
  497. namespace views
  498. {
  499. struct all_fn;
  500. }
  501. template<typename Rng, typename Fun>
  502. struct chunk_by_view;
  503. namespace views
  504. {
  505. struct chunk_by_fn;
  506. }
  507. template<typename Rng>
  508. struct const_view;
  509. namespace views
  510. {
  511. struct const_fn;
  512. }
  513. template<typename I>
  514. struct counted_view;
  515. namespace views
  516. {
  517. struct counted_fn;
  518. }
  519. struct default_sentinel_t;
  520. template<typename I>
  521. struct move_iterator;
  522. template<typename I>
  523. using move_into_iterator = basic_iterator<detail::move_into_cursor<I>>;
  524. template<typename Rng, bool = (bool)is_infinite<Rng>()>
  525. struct RANGES_EMPTY_BASES cycled_view;
  526. namespace views
  527. {
  528. struct cycle_fn;
  529. }
  530. /// \cond
  531. namespace detail
  532. {
  533. template<typename I>
  534. struct reverse_cursor;
  535. }
  536. /// \endcond
  537. template<typename I>
  538. using reverse_iterator = basic_iterator<detail::reverse_cursor<I>>;
  539. template<typename T>
  540. struct empty_view;
  541. namespace views
  542. {
  543. struct empty_fn;
  544. }
  545. template<typename Rng, typename Fun>
  546. struct group_by_view;
  547. namespace views
  548. {
  549. struct group_by_fn;
  550. }
  551. template<typename Rng>
  552. struct indirect_view;
  553. namespace views
  554. {
  555. struct indirect_fn;
  556. }
  557. struct unreachable_sentinel_t;
  558. template<typename From, typename To = unreachable_sentinel_t>
  559. struct iota_view;
  560. template<typename From, typename To = From>
  561. struct closed_iota_view;
  562. namespace views
  563. {
  564. struct iota_fn;
  565. struct closed_iota_fn;
  566. } // namespace views
  567. template<typename Rng>
  568. struct join_view;
  569. template<typename Rng, typename ValRng>
  570. struct join_with_view;
  571. namespace views
  572. {
  573. struct join_fn;
  574. }
  575. template<typename... Rngs>
  576. struct concat_view;
  577. namespace views
  578. {
  579. struct concat_fn;
  580. }
  581. template<typename Rng, typename Fun>
  582. struct partial_sum_view;
  583. namespace views
  584. {
  585. struct partial_sum_fn;
  586. }
  587. template<typename Rng>
  588. struct move_view;
  589. namespace views
  590. {
  591. struct move_fn;
  592. }
  593. template<typename Rng>
  594. struct ref_view;
  595. namespace views
  596. {
  597. struct ref_fn;
  598. }
  599. template<typename Val>
  600. struct repeat_view;
  601. namespace views
  602. {
  603. struct repeat_fn;
  604. }
  605. template<typename Rng>
  606. struct RANGES_EMPTY_BASES reverse_view;
  607. namespace views
  608. {
  609. struct reverse_fn;
  610. }
  611. template<typename Rng>
  612. struct slice_view;
  613. namespace views
  614. {
  615. struct slice_fn;
  616. }
  617. // template<typename Rng, typename Fun>
  618. // struct split_view;
  619. // namespace views
  620. // {
  621. // struct split_fn;
  622. // }
  623. template<typename Rng>
  624. struct single_view;
  625. namespace views
  626. {
  627. struct single_fn;
  628. }
  629. template<typename Rng>
  630. struct stride_view;
  631. namespace views
  632. {
  633. struct stride_fn;
  634. }
  635. template<typename Rng>
  636. struct take_view;
  637. namespace views
  638. {
  639. struct take_fn;
  640. }
  641. /// \cond
  642. namespace detail
  643. {
  644. template<typename Rng>
  645. struct is_random_access_common_;
  646. template<typename Rng,
  647. bool IsRandomAccessCommon = is_random_access_common_<Rng>::value>
  648. struct take_exactly_view_;
  649. } // namespace detail
  650. /// \endcond
  651. template<typename Rng>
  652. using take_exactly_view = detail::take_exactly_view_<Rng>;
  653. namespace views
  654. {
  655. struct take_exactly_fn;
  656. }
  657. template<typename Rng, typename Pred>
  658. struct iter_take_while_view;
  659. template<typename Rng, typename Pred>
  660. struct take_while_view;
  661. namespace views
  662. {
  663. struct iter_take_while_fn;
  664. struct take_while_fn;
  665. } // namespace views
  666. template<typename Rng, typename Regex, typename SubMatchRange>
  667. struct tokenize_view;
  668. namespace views
  669. {
  670. struct tokenize_fn;
  671. }
  672. template<typename Rng, typename Fun>
  673. struct iter_transform_view;
  674. template<typename Rng, typename Fun>
  675. struct transform_view;
  676. namespace views
  677. {
  678. struct transform_fn;
  679. }
  680. template<typename Rng, typename Val1, typename Val2>
  681. using replace_view = iter_transform_view<Rng, detail::replacer_fn<Val1, Val2>>;
  682. template<typename Rng, typename Pred, typename Val>
  683. using replace_if_view = iter_transform_view<Rng, detail::replacer_if_fn<Pred, Val>>;
  684. namespace views
  685. {
  686. struct replace_fn;
  687. struct replace_if_fn;
  688. } // namespace views
  689. template<typename Rng, typename Pred>
  690. struct trim_view;
  691. namespace views
  692. {
  693. struct trim_fn;
  694. }
  695. template<typename I>
  696. struct unbounded_view;
  697. namespace views
  698. {
  699. struct unbounded_fn;
  700. }
  701. template<typename Rng>
  702. using unique_view = adjacent_filter_view<Rng, logical_negate<equal_to>>;
  703. namespace views
  704. {
  705. struct unique_fn;
  706. }
  707. template<typename Rng>
  708. using keys_range_view = transform_view<Rng, detail::get_first>;
  709. template<typename Rng>
  710. using values_view = transform_view<Rng, detail::get_second>;
  711. namespace views
  712. {
  713. struct keys_fn;
  714. struct values_fn;
  715. } // namespace views
  716. template<typename Fun, typename... Rngs>
  717. struct iter_zip_with_view;
  718. template<typename Fun, typename... Rngs>
  719. struct zip_with_view;
  720. template<typename... Rngs>
  721. struct zip_view;
  722. namespace views
  723. {
  724. struct iter_zip_with_fn;
  725. struct zip_with_fn;
  726. struct zip_fn;
  727. } // namespace views
  728. } // namespace ranges
  729. /// \cond
  730. namespace ranges
  731. {
  732. namespace concepts = ::concepts;
  733. using namespace ::concepts::defs;
  734. using ::concepts::and_v;
  735. } // namespace ranges
  736. /// \endcond
  737. RANGES_DIAGNOSTIC_POP
  738. #include <range/v3/detail/epilogue.hpp>
  739. #endif