23 stream <<
"\n--- for_workhorse(), Powerful Compile-Time Loop " <<
endL;
25 stream <<
" 1. for_workhorse<10>(lambda) - for_workhorse<End>(lambda)" <<
endL;
28 types::for_workhorse<10>(
36 stream <<
" <- [ 0, 10 ), Span: +1, 10 not included" <<
endL;
38 stream <<
" 2. for_workhorse<10, 20>(lambda) - for_workhorse<Start, End>(lambda)" <<
endL;
41 types::for_workhorse<10, 20>(
49 stream <<
" <- [ 10, 20 ), Span: +1, 20 not included" <<
endL;
51 stream <<
" 3. for_workhorse<0, 20, 2>(lambda) - for_workhorse<Start, End, Increment>(lambda)" <<
endL;
54 types::for_workhorse<0, 20, 2>(
62 stream <<
" <- [ 0, 20 ), Span: +2, 20 not included" <<
endL;
64 stream <<
" 4. for_workhorse<1, 20, 2>(lambda) - for_workhorse<Start, End, Increment>(lambda)" <<
endL;
67 types::for_workhorse<1, 20, 2>(
75 stream <<
" <- [ 1, 20 ), Span: +2, 20 not included" <<
endL;
77 stream <<
" 5. for_workhorse<20, 0, -2>(lambda) - for_workhorse<Start, End, Increment>(lambda)" <<
endL;
88 stream <<
" <- [ 20, 0 ), Span: -2, 0 not included" <<
endL;
90 stream <<
" 6. for_workhorse<19, 0, -2>(lambda) - for_workhorse<Start, End, Increment>(lambda)" <<
endL;
101 stream <<
" <- [ 19, 0 ), Span: -2, 0 not included" <<
endL;
103 stream <<
" 7. for_workhorse<10, 0, -2>(lambda) - for_workhorse<Start, End, Increment>(lambda)" <<
endL;
114 stream <<
" <- [ 10, 0 ), Span: -2, 0 not included" <<
endL;
116 stream <<
" 8. for_workhorse<9, 0, -2>(lambda) - for_workhorse<Start, End, Increment>(lambda)" <<
endL;
127 stream <<
" <- [ 9, 0 ), Span: -2, 0 not included" <<
endL;
133 stream <<
"--- Iterating 2D Loop using for_workhorse() - 4 x 3 tuple matrix " <<
endL;
135 std::tuple M{ 0, 1, 2,
154 constexpr auto index = indexer.
Column * i.Index + j.Index;
156 stream << std::get<index>(M);
158 if constexpr(j.Index != j_info.Last)
164 if constexpr(i.Index != i_info.Last)
173 stream <<
"--- Printing tuple using for_workhorse() - IN ORDER" <<
endL;
175 std::tuple tuple{ 0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9 };
187 if constexpr(i.Index != i_info.Last)
193 stream <<
"--- Printing tuple using for_workhorse() - IN REVERSE ORDER" <<
endL;
201 if constexpr(i.Index != i_info.Last)
207 stream <<
"\t\t--- By Thomas Kim, Feb. 05, 2020. ---" <<
endl;
void test_workhorse_multi_level_loop()
void test_workhorse_basic()
void test_workhorse_print_tuple()
void for_workhorse(WorkType &&work, std::integer_sequence< T, Indices... >, ArgTypes &&... args)
constexpr decltype(auto) get(T(&c_array)[N]) noexcept
constexpr auto tuple_size_v
Type to string name conversions are defined.
static constexpr T Column
Stream output operators << are implemented.