In this question here a solution was suggested on how to check for the value type of a generic container, e.g. check if a std::vector
contains integral
. Now, sometimes I might be passing 2D vectors i.e. containers of containers that eventually has either a floating point or integral type.
How can we modify the following concept to incorporate this, so that std::vector<std::vector<int>>
won't fail if we expect it to contain integral types. In my application it won't make sense to go above std::vector<std::vector<int>>
- matrix-like arrays. So the solution does not need to check for endless nested containers.
template< typename U, typename Tin, typename Tout>
concept MyConditions =
requires
{
typename U::value_type;
typename Tin::value_type;
typename Tout::value_type;
requires std::integral<typename T::value_type>;
requires std::floating_point<typename U::value_type>;
requires std::floating_point<typename Tout::value_type>;
};