Boost logo

Boost :

From: Greg Colvin (greg_at_[hidden])
Date: 2002-06-27 18:36:15

At 01:42 PM 06/26/2002, David Abrahams wrote:

>From: "Greg Colvin" <greg_at_[hidden]>
>> Doesn't seem like it should have to, but no such luck.
>> Of course lots of code using pointers expects never to
>> encounter a null pointer anyway, and I'd expect to see
>> code that tests for null-ness to use p directly before
>> the conversion to a raw pointer. But I don't know what
>> the use cases are for mumble_ptr.
>There should be a uniform way to get the raw pointer for any smart pointer,
>even if it's null.


>> I've been traveling and am jumping in late, so mabye
>> this went by already, but I could see the point in
>> defining raw_ptr<T> as a wrapper class for a raw
>> pointer which, unlike shared_ptr and all, has a
>> conversion to T*.
>I don't see the advantage over having raw_ptr be a function template which
>returns a T*. At least then the user doesn't have to explicitly specify the
>template argument.

So you can write generic code like

   template<template<typename T> class Ptr> struct x { Ptr<T> p; };

and have a Ptr with raw pointer semantics.

I didn't mean this as a replacement for mumble_pointer, but as a
reason not to use the name raw_pointer.

Boost list run by bdawes at, gregod at, cpdaniel at, john at