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

Check if the type T constitutes a map from type From to type To. More...

#include <concept.h>

Concept definition

template<class T, class From, class To>
concept lucid::MapFromTo = requires(T t) {
{ t.at(From{}) } -> std::convertible_to<To>;
}
Check if the type T constitutes a map from type From to type To.
Definition concept.h:44

Detailed Description

Check if the type T constitutes a map from type From to type To.

It has to have a method at that takes a From and returns a To.

template <MapFromTo<int, std::string> T>
void foo(T t); // T can be a map from int to std::string or a vector of std::string
Template Parameters
Ttype to check
Fromtype domain
Totype codomain