Callable object creating a tuple of product types, each containing N consecutive elements from t. Tiles starts at 0 and advance by O element each time.
On record types, this function operates on elements as if they were ordered. The considered order is the order of declaration.
- Note
- Tiles is the most general form of tiling each inner product_type is a tile over t starting at index tile_size * tile_number + 1. The last tile will be smaller if the size of the product type is not a multiple of the tile size.
#include <kumi/algorithm/apply.hpp>
template<std::size_t N, std::size_t O, product_type T>
constexpr tiles_t< N, O > tiles
Callable object creating a tuple of product types, each containing N consecutive elements from t....
Definition tiler.hpp:98
- N: Size of the tile to generate
- O: Offset from the begening of the previous tile
- t: Product Type from which to extract the tiles
- A tuple of product types, each containing N consecutive elements of t offset by O
template<std::
size_t N, std::
size_t O, kumi::concepts::product_type T>
struct tiles
{
};
template<std::size_t N, std::size_t O, kumi::concepts::product_type T>
using tiles_t = typename kumi::result::tiles<N, O, T>::type;
Computes the return type of a call to kumi::tiles
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
auto t =
kumi::tuple{1,
'y', 3.f,
short{55}, -8, 66.,
"Pete"};
std::cout << " Standard Tiles" << "\n";
std::cout << w << "\n";
{
get<0>(tile)++;
},w);
std::cout << t << "\n";
std::cout << " Tiles with references " << "\n";
std::cout << w2 << "\n";
{
get<0>(tile)++;
},w2);
std::cout << t << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
auto r =
kumi::record{
"a"_id = 1,
"b"_id =
'y',
"c"_id = 3.f,
"d"_id =
short{55}
,"e"_id = -8, "f"_id = 66., "g"_id = "Pete"};
std::cout << " Standard Tiles" << "\n";
std::cout << w << "\n";
{
},w);
std::cout << r << "\n";
std::cout << " Tiles with references " << "\n";
std::cout << w2 << "\n";
{
},w2);
std::cout << r << "\n";
}
decltype(auto) constexpr get(record< Ts... > &r) noexcept
Extracts the Ith field from a kumi::record.
Definition record.hpp:618
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36
constexpr auto values_of(T &&t) noexcept
Extracts the values of the fields of a kumi::product_type.
Definition tuple.hpp:772