From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16708 invoked by alias); 7 May 2003 23:36:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 16694 invoked by uid 71); 7 May 2003 23:36:01 -0000 Date: Wed, 07 May 2003 23:36:00 -0000 Message-ID: <20030507233601.16693.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Giovanni Bajo" Subject: Re: c++/10649: is_pointer reports pointer to member function is not a pointer Reply-To: "Giovanni Bajo" X-SW-Source: 2003-05/txt/msg00517.txt.bz2 List-Id: The following reply was made to PR c++/10649; it has been noted by GNATS. From: "Giovanni Bajo" To: , , , , Cc: Subject: Re: c++/10649: is_pointer reports pointer to member function is not a pointer Date: Thu, 8 May 2003 01:34:52 +0200 Robert Schwartz wrote: > is_pointer::value (i.e. pointer to member variable) evaluates > to true. > If I remove the * from "int foo::*", then I get "int foo::". > I know this isn't a valid C++ type, but a pointer to a member variable is > still a pointer, no? > > If I remove the * from "int (foo::*)(void)", then I get "int (foo::)(void)". > I know this isn't a valid C++ type, but a pointer to a member function is > still a pointer, no? I'm not arguing about what is a pointer and what is not. I'm saying that a compiler can't instantiate your template with "T = int foo::" because "int foo::" is not a type, like you are stating yourself. This does not mean that a pointer to a member function or a member variable is not a pointer. It simply means that your way to detect what is a pointer and what is not a pointer is wrong. You can check the Type Trait library within Boost, they have metafunctions to check for every thing you can think of about types, and they work on every compiler out there (most of them can work even without partial specialization). It will give you an idea about how to implement such constructs. Giovanni Bajo