🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2125

Re: Do we need a standard isPointer() function?

#2125
From: Fergus Henderson
Date: Thu, 05 Oct 1995 18:31
52 lines
2605 bytes
Distribution:
Newsgroups: comp.std.c++
Path: munta.cs.mu.OZ.AU!fjh
From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
Subject: Re: Do we need a standard isPointer() function?
Message-ID: <9527818.9819@mulga.cs.mu.OZ.AU>
Sender: news@cs.mu.OZ.AU (CS-Usenet)
Organization: Computer Science, University of Melbourne, Australia
References: <439kkn$n81@caesar.ultra.net> <9525806.29066@mulga.cs.mu.OZ.AU> <44hevp$ofa@caesar.ultra.net>
Date: Thu, 5 Oct 1995 08:48:30 GMT
Lines: 34

phalpern@truffle.ultranet.com (Pablo Halpern) writes:

>fjh@munta.cs.mu.OZ.AU (Fergus Henderson) wrote:
>
>>	template <class T>
>>	struct ext_type_info {
>>		enum { is_pointer = false };	// assume T is not a pointer...
>>	}
>
>>	// define a partial specialization
>>	template <class U>
>>	struct ext_type_info<U *> {		// ... unless it matches this
>>		enum { is_pointer = true };	// partial specialization
>>	}
>
>>[This is now legal C++, but I don't know of any compilers that
>>support partial specialization yet.]
>
>This does not look like partial specialization to me. Partial
>specialization, as I understand it, is where you specify implementation
>details for a template where one or more of the template paramters are
>known at compile time. The code above does not use compile-time
>parameters but uses a notation to *imply* that the "partialy
>specialized" template is for pointer parameters only. Is this really
>legal in the current WP?

Yes, it really is legal.  See section 14.6 [temp.class.spec] of the
draft standard.

-- 
Fergus Henderson             |  "Australia is the richest country in the world,
fjh@cs.mu.oz.au              |   according to a new system of measuring wealth
http://www.cs.mu.oz.au/~fjh  |   announced by the World Bank yesterday."
PGP: finger fjh@128.250.37.3 |  - Melbourne newspaper "The Age", 18 Sept 1995.

---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <9527818.9819@mulga.cs.mu.OZ.AU>
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
References: <439kkn$n81@caesar.ultra.net> <9525806.29066@mulga.cs.mu.OZ.AU> <44hevp$ofa@caesar.ultra.net>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
Newsgroups: comp.std.c++
Subject: Re: Do we need a standard isPointer() function?
Date: 05 Oct 1995 18:31:28 GMT
Organization: Computer Science, University of Melbourne, Australia
Approved: matt@physics2.Berkeley.EDU (Matt Austern)
Message-ID: <9527818.9819@mulga.cs.mu.OZ.AU>
References: <439kkn$n81@caesar.ultra.net> <9525806.29066@mulga.cs.mu.OZ.AU> <44hevp$ofa@caesar.ultra.net>
NNTP-Posting-Host: physics2.berkeley.edu