Hi,
what you are looking for is universal quantification, and AFAIK concepts don't take in account this case.
What you can do is to define a concept RebindableWith<R,T> that is defined if the application of the nested rebind template alias is defined.
What I have done with TypeConstructible, Functor, Applicative, Monad is to force an explicit trait that states explicitly that the type is a model of the concept. This is cumbersome and doesn't do any syntactical check, but this is what I've do as my best. Of course, if the type is not a model, the compiler messages are as bad asif we had do noting at all.
Anyway, if someone knows how to express the Rebindable concept I'm interested also.
Vicente
> Message du 18/07/17 11:49
> De : "Andrzej Krzemieński" <akrz...@gmail.com>
> A : "SG8 - Concepts" <conc...@isocpp.org>
> Copie à :
> Objet : [concepts] How to constrain on presence of rebind<>
>
>
Hi Everyone,
> I have the following expectation of my types, and I would like to check it with a concept constraint.
> Of each type T that pretends to satisfy requirements Rebindable I expect that they have a nested template `rebind` that looks like:
>
> struct R
> {
> template
> using rebind = /*...*/;
> };
>
> That is, `R::rebind` (or `R::template rebind`) or should represent a type (`void` is just an example, but it could be any `T`.
template<typename T>
struct B {
template<typename U>
using rebind = A<U>; // rebind<> should construct a `B`
};