[ConceptGCC] |
ConceptGCC :Re: Concepts and member functions |
From: Jacob Smith (jaroslov_at_[hidden])
Date: 2009-04-27 14:56:43
Do you mean something like this?
concept C1<typename T> { ... }
concept C2<typename T> { ... }
concept C1andC2<typename First, typename Second> { ... }
template <C1 C1_type, C2 C2_type>
requires C1and2<C1_type, C2_type>
struct C1_and_C2_have_relationship {
};
I'm not sure what you want from the "relationship" but, in my
experience, when two types are involved in a requirement clause or
concept, they are usually involved in a SameType or Convertibility
constraint on associated types.
There are also a lot of ways of defining "inline" requirements in the
body of a class, but I'm unsure if ConceptGCC supports those.
-j.
On 4/27/09, Mirko Stocker <me_at_[hidden]> wrote:
> Hi
>
> Giving this mailing list another try, maybe I'll get some reactions if I
> post
> a (hopefully) interesting question:
>
> Given the following code, how can I form a relationship between TestClass
> and
> MemFun?
>
> template <typename TestClass, typename MemFun>
> struct incarnate_for_member_function {
> MemFun memfun;
> incarnate_for_member_function(MemFun f):memfun(f){}
> void operator()(){
> TestClass t;
> (t.*memfun)();
> }
> };
>
> Regards
>
> Mirko
>
> _______________________________________________
> ConceptGCC mailing list
> ConceptGCC_at_[hidden]
> http://www.osl.iu.edu/mailman/listinfo.cgi/conceptgcc
>