KUMI v4.0.0
Flawless Fluorite
Loading...
Searching...
No Matches

◆ is_container_v

template<typename T>
bool kumi::is_container_v = kumi_implementation_defined
inlineconstexpr

Traits detecting types behaving like a kumi::container.

Template Parameters
TType to inspect

To be treated like a container, a user defined type must expose general container utilities. Those beeing :

  • .size();
  • .begin();
  • .end();
Note
Standard C arrays are considered container types.

Helper type-trait

namespace kumi
{
template<typename T> struct is_container;
}
Main KUMI namespace.
Definition algorithm.hpp:11

Example:

#include <kumi/kumi.hpp>
#include <iostream>
#include <array>
#include <span>
#include <vector>
int main()
{
auto data = std::array{1,2,3,4,5,6,7,8,9,10};
kumi::for_each([](auto elt){ std::cout << elt << ", "; }, data);
std::cout << "\n";
auto my_span = std::span(data);
kumi::for_each([](auto elt){ std::cout << elt << ", "; }, kumi::to_tuple(my_span));
}
Concept specifying a type follows the Product Type semantic.
Definition concepts.hpp:77
Concept specifying a type follows the Container Type semantic.
Definition concepts.hpp:124
constexpr for_each_t for_each
Callable object applying the Callable object f on each element of a product type.
Definition for_each.hpp:133