lucid  0.0.1
Lifting-based Uncertain Control Invariant Dynamics
Loading...
Searching...
No Matches
lucid::SizedDataContainer Concept Reference

Check if the type T is a data container of type U having a data() method which returns a raw pointer and a size() method which returns the size of the container. More...

#include <concept.h>

Concept definition

template<class T, class U>
concept lucid::SizedDataContainer = requires(T t) {
{ t.data() } -> std::convertible_to<U*>;
{ t.size() } -> std::convertible_to<std::size_t>;
}
Check if the type T is a data container of type U having a data() method which returns a raw pointer ...
Definition concept.h:27

Detailed Description

Check if the type T is a data container of type U having a data() method which returns a raw pointer and a size() method which returns the size of the container.

template <class U, SizedDataContainer<U> T>
void foo(T t); // T can be a vector or any other data container of type U with a data() and size() method
Template Parameters
Ttype to check
Utype of the elements