🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Why no iterator::operator T*() in STL?

#1553
From: John Max Skaller
Date: Wed, 02 Aug 1995 15:45
19 lines
1044 bytes
In article <1995Jul19.180847.17243@ptolemy-ethernet.arc.nasa.gov>,
Paul J. Lucas <pjl@kronos.arc.nasa.gov> wrote:
>	Why shouldn't I be able to do:
>
>		list< int > x;
>		list< int >::iterator i;
>		int *p = i;	// use list< int >::operator int*()
>
>	i.e., convert the iterator to its underlying pointer?

	Use:

	int *p = &*i;

--
        JOHN (MAX) SKALLER,         INTERNET:maxtal@suphys.physics.su.oz.au
	Maxtal Pty Ltd,		    
        81A Glebe Point Rd, GLEBE   Mem: SA IT/9/22,SC22/WG21 
        NSW 2037, AUSTRALIA	    Phone: 61-2-566-2189
Technical Details
Message-ID: <3vo6iv$grf@metro.ucc.su.OZ.AU>
Path: arc1-ca.pugleaf.net!news.cs.su.oz.au!metro!news
References: <1995Jul19.180847.17243@ptolemy-ethernet.arc.nasa.gov>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.cs.su.oz.au!metro!news
From: maxtal@Physics.usyd.edu.au (John Max Skaller)
Newsgroups: comp.std.c++
Subject: Re: Why no iterator::operator T*() in STL?
Date: 2 Aug 1995 15:45:35 GMT
Organization: School of Physics, University of Sydney, Australia
Distribution: inet
Message-ID: <3vo6iv$grf@metro.ucc.su.OZ.AU>
References: <1995Jul19.180847.17243@ptolemy-ethernet.arc.nasa.gov>
NNTP-Posting-Host: physics.su.oz.au
Keywords: STL iterator pointer conversion