#include "catch.hpp"
#include "kblib/logic.h"
#include <array>
#include <iostream>
#include <string>
Go to the source code of this file.
|
template<int I1, int I2> |
auto | multi_template () -> int |
|
template<std::size_t COL, typename T , std::size_t rows, std::size_t cols, std::size_t... row> |
constexpr auto | get_col (const std::array< std::array< T, cols >, rows > &in, std::index_sequence< row... >) -> std::array< T, rows > |
|
template<typename T , std::size_t rows, std::size_t cols, std::size_t... row, std::size_t... col> |
constexpr auto | transpose_arr_impl (const std::array< std::array< T, cols >, rows > &in, std::index_sequence< col... >) -> std::array< std::array< T, rows >, cols > |
|
template<typename T , std::size_t rows, std::size_t cols> |
constexpr auto | transpose_arr (std::array< std::array< T, cols >, rows > in) -> std::array< std::array< T, rows >, cols > |
|
| TEST_CASE ("transpose") |
|
template<int I2, int... Is1> |
constexpr auto | gen_row (tag< Is1... >) -> std::array< int(*)(), 8 > |
|
template<typename Tag1 , int... Is2> |
constexpr auto | gen_dispatch_table () -> std::array< std::array< int(*)(), 8 >, 8 > |
|
auto | multi_dispatcher (int i1, int i2) -> int |
|
| TEST_CASE ("run-time template dispatching") |
|
◆ gen_dispatch_table()
template<typename Tag1 , int... Is2>
constexpr auto gen_dispatch_table |
( |
| ) |
-> std::array<std::array<int (*)(), 8>, 8> |
|
constexpr |
◆ gen_row()
template<int I2, int... Is1>
constexpr auto gen_row |
( |
tag< Is1... > |
| ) |
-> std::array<int (*)(), 8> |
|
constexpr |
◆ get_col()
template<std::size_t COL, typename T , std::size_t rows, std::size_t cols, std::size_t... row>
constexpr auto get_col |
( |
const std::array< std::array< T, cols >, rows > & |
in, |
|
|
std::index_sequence< row... > |
|
|
) |
| -> std::array<T, rows> |
|
constexpr |
◆ multi_dispatcher()
auto multi_dispatcher |
( |
int |
i1, |
|
|
int |
i2 |
|
) |
| -> int |
◆ multi_template()
template<int I1, int I2>
auto multi_template |
( |
| ) |
-> int |
◆ TEST_CASE() [1/2]
TEST_CASE |
( |
"run-time template dispatching" |
| ) |
|
◆ TEST_CASE() [2/2]
TEST_CASE |
( |
"transpose" |
| ) |
|
◆ transpose_arr()
template<typename T , std::size_t rows, std::size_t cols>
constexpr auto transpose_arr |
( |
std::array< std::array< T, cols >, rows > |
in | ) |
-> std::array<std::array<T, rows>, cols> |
|
constexpr |
◆ transpose_arr_impl()
template<typename T , std::size_t rows, std::size_t cols, std::size_t... row, std::size_t... col>
constexpr auto transpose_arr_impl |
( |
const std::array< std::array< T, cols >, rows > & |
in, |
|
|
std::index_sequence< col... > |
|
|
) |
| -> std::array<std::array<T, rows>, cols> |
|
constexpr |
◆ dispatch_table
constexpr std::array<std::array<int (*)(), 8>, 8> dispatch_table |
|
constexpr |
Initial value:= gen_dispatch_table<tag<6, 13, 14, 19, 22, 22, 24, 27>, 1, 3, 5, 6, 18, 21,
25, 31>()
Definition at line 68 of file logic.cpp.