[ConceptGCC] |
ConceptGCC :Re: Concepts and member functions |
From: Sebastian Gesemann (s.gesemann_at_[hidden])
Date: 2009-04-28 04:30:37
On Mon, Apr 27, 2009 at 9:42 PM, Mirko Stocker <me_at_[hidden]> wrote:
> It all started when I changed:
>
> Â template <typename TestClass,typename MemFun>
> to
> Â template <std::DefaultConstructible TestClass,std::CopyConstructible MemFun>
>
> and that lead to the following error:
>
> error: â((cute::incarnate_for_member_function<TestClass, MemFun>*)this)-
>>cute::incarnate_for_member_function<TestClass, MemFun>::memfunâ cannot be
> used as a member pointer, since it is of type âMemFunâ
>
> So I thought I'd need to express that MemFun is a member pointer to TestClass,
> and that's where I'm stuck right now :) Or am I doing something
> unnecessary/unconvential/stupid here?
I don't think there's direct support of pointer to member types in the
concept system.
You could do something like this:
template<ClassType TestClass, Returnable R>
requires DefaultConstructible<TestClass>
class foo {
R (TestClass::*memfun)();
...
};
Cheers!
SG