| Re: How to convert a pointer to member function type to a const member one |
|
 |
|
 |
|
 |
|
 |
Group: comp.lang.c++.moderated · Group Profile
Author: nickf3nickf3 Date: Apr 30, 2008 15:11
On Apr 30, 12:38 pm, mcostalba gmail.com> wrote:
> Hi all,
>
> I have a problem.
>
> What is the best way to get a type TC from a type T where
>
> T is int(foo::*)(char)
>
> and
>
> TC is int(foo::*)(char) const
>
> I have tried
>
> typdef T const TC
>
> but with no success.
>
> Thanks
> Marco
>
Marco,
T and TC here are not convertible to each other, because members
they point to have different signatures (because of const)
Saying 'typedef const T X' only produces "unmodifiable pointer
to member" type, it does not create "pointer to const member" type.
Hope this helps.
|