"Phil Nash" <[EMAIL PROTECTED]> writes:

>> >> >     Pointers are Resources
>> >> >     Resources are not (all) Pointers.
>> >>
>> >> Actually,
>> >>
>> >>       Pointers *refer to* resources
>> >>       Not all pointers refer to (are) resources
>> >
>> > How about:
>> >
>> >         Pointers are a way of referring to resources.
>> >         Not all ways of referring to resources are pointers.
>
> Alright - it seems everyone pulled me up on that lapse - I must remember to
> be more careful round here ;-)
>
>> But also:
>>
>>           Not all pointers refer to resources.
>
> Hmmm, unless you are thinking of null pointers I can't think of any pointers
> that don't refer to resources. Perhaps we have a different definition of
> resource?
> Could you elaborate?

I think of resources as things which can be separately managed
independent of other objects.  Here are some examples of non-resource
pointers:

void f()
{
    int x;
    int* p1 = x;  // arguable
    std::pair<int,int> y;
    int* p2 = x.first;
    std::pair<int,int>* y2 = new std::pair<int,int>;
    int* p3 = y2.first;
}

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to