@@ -49,26 +49,7 @@ namespace itertools {
4949 *
5050 * This function returns an iterable lazy object, which can be used in range-based for loops:
5151 *
52- * @code{.cpp}
53- * for (auto i : range(5)) {
54- * std::cout << i << " ";
55- * }
56- * std::cout << "\n";
57- *
58- * for (auto i : range(-2, 1)) {
59- * std::cout << i << " ";
60- * }
61- * std::cout << "\n";
62- *
63- * for (auto i : range(10, 3, -2)) {
64- * std::cout << i << " ";
65- * }
66- * std::cout << "\n";
67- *
68- * for (auto i : range(0, 10, -1)) {
69- * std::cout << i << " "; // empty
70- * }
71- * @endcode
52+ * @include doc_range.cpp
7253 *
7354 * Output:
7455 *
@@ -106,7 +87,8 @@ namespace itertools {
10687
10788 /* *
10889 * @brief Default constructor.
109- * @deprecated Use range::range(long, long) or range::range(long, long, long) instead.
90+ * @deprecated Use range::range(std::integral auto, std::integral auto) or range::range(std::integral auto,
91+ * std::integral auto, std::integral auto) instead.
11092 */
11193 [[deprecated(" range default construction deprecated. Use range::all for full range in slicing operation" )]] range() = default ;
11294
@@ -370,11 +352,7 @@ namespace itertools {
370352 * @details The given integers specify the excluded last values of the individual itertools::range objects. Each range
371353 * starts at 0 and has a step size of 1.
372354 *
373- * @code{.cpp}
374- * for (auto [i1, i2] : product_range(2, 3)) {
375- * std::cout << "(" << i1 << ", " << i2 << ")\n";
376- * }
377- * @endcode
355+ * @include doc_product_range.cpp
378356 *
379357 * Output:
380358 *
@@ -407,25 +385,7 @@ namespace itertools {
407385 /* *
408386 * @brief Create a cartesian product range of integer ranges from a tuple of integers.
409387 *
410- * @details The integers in the given tuple specify the excluded last values of the individual itertools::range
411- * objects. Each range starts at 0 and has a step size of 1.
412- *
413- * @code{.cpp}
414- * for (auto [i1, i2] : product_range(std::make_tuple(2, 3))) {
415- * std::cout << "(" << i1 << ", " << i2 << ")\n";
416- * }
417- * @endcode
418- *
419- * Output:
420- *
421- * ```
422- * (0, 0)
423- * (0, 1)
424- * (0, 2)
425- * (1, 0)
426- * (1, 1)
427- * (1, 2)
428- * ```
388+ * @details It simply forwards the integers in the given tuple to itertools::product_range.
429389 *
430390 * @tparam Is Integer types.
431391 * @param idx_tpl Tuple containing the excluded last values of the integer ranges.
@@ -439,25 +399,7 @@ namespace itertools {
439399 /* *
440400 * @brief Create a cartesian product range of integer ranges from an array of integers.
441401 *
442- * @details The integers in the given array specify the excluded last values of the individual itertools::range
443- * objects. Each range starts at 0 and has a step size of 1.
444- *
445- * @code{.cpp}
446- * for (auto [i1, i2] : product_range(std::array{2, 3})) {
447- * std::cout << "(" << i1 << ", " << i2 << ")\n";
448- * }
449- * @endcode
450- *
451- * Output:
452- *
453- * ```
454- * (0, 0)
455- * (0, 1)
456- * (0, 2)
457- * (1, 0)
458- * (1, 1)
459- * (1, 2)
460- * ```
402+ * @details It simply forwards the integers in the given array to itertools::product_range.
461403 *
462404 * @tparam I Integer type.
463405 * @tparam N Number of elements in the array.
@@ -472,12 +414,7 @@ namespace itertools {
472414 /* *
473415 * @brief Apply a function to every element of an integer itertools::range.
474416 *
475- * @code{.cpp}
476- * // print out the first 10 squares
477- * itertools::foreach(itertools::range(1, 11), [](int i) {
478- * std::cout << i * i << " ";
479- * });
480- * @endcode
417+ * @include doc_for_each.cpp
481418 *
482419 * Output:
483420 *
0 commit comments