I would like the template method m
in the concept
D
to be restricted by another concept
E
, something like this:
template <typename t>
concept E = requires(t p_t) {
std::default_initializable<t>;
std::copy_constructible<t>;
std::move_constructible<t>;
typename t::x;
requires std::is_convertible_v<typename t::x, int>;
};
template <typename t>
concept D = requires(t p_t) {
{ template <E e> p_t.m<E>() } -> std::same_as<float>;
};
but the line { template <E e> p_t.m<E>() } -> std::same_as<float>;
does not compile, it generates the error "Expected expression".
If I understood right what is discussed here, it is not possible, but I wonder if someone else knows a way to do it.