From: Phil Nash (phil.nash.lists_at_[hidden])
Date: 2003-02-20 14:39:36
> >Hmmm, unless you are thinking of null pointers I can't think of any
> >that don't refer to resources. Perhaps we have a different definition of
> Or of 'refer to resources'?
> char * ptr = new char ; // points to (ergo, refers to) resource
> char * ptr2 = ptr+4 ; // points _into_ resource
Hmmm... it could be argued that each char in the block pointed to by ptr is
an individual resource, with a common manager on the heap.
However, that may be stretching it a bit and I am prepared to accept your
example as demonstrating that (especially within the context of RAII) not
all (non-null) pointers refer to resources.
That said I don't see that it affects my original argument (just the wording
AFAICS it still stands that "smart pointer" is an incorrect and even
misleading (certainly confusing) term when applied to something that doesn't
have pointer semantics.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk