delpi  0.0.1
DElta-complete LP solver
Loading...
Searching...
No Matches
delpi::MapFromTo Concept Reference

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

#include <concepts.h>

Concept definition

template<class T, typename From, typename To>
concept 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 concepts.h:27

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

Definition at line 27 of file concepts.h.